Thursday, December 17, 2009

Create a Custom Page in Share

In this bog entry, I will add new custom page in Alfresco Share. This page can be added to our site same as other pages like wiki, document library, calendar etc.

I have taken reference from this post.

Whenever you want to do any customization in alfresco, rather then doing it from scratch, refer what is out-of-box available and try to follow the same flow.

To add page in alfresco is similar to Alfresco Surf (if you are familiar with that)

Step -1
The starting point of adding Page is , Create a xml file named helloPage.xml in the following folder


Add the following code in the file  helloPage.xml
This file defines, title, description and name of template-instance

<?xml version='1.0' encoding='UTF-8'?>
<title>Hello Page</title>
<description>Simple test page</description>

Now, create template-instance named - helloPage.xml in the following folder


Add the following code in the template-instance file. This file defines the name and path of template file.  Here, file name is – sample-helloPage.ftl and path is org/alfresco/

<?xml version='1.0' encoding='UTF-8'?>


Now, create template-instance named - sample-helloPage.ftl in the following folder


This page actually renders all the required contents of your page.
It may include different components.

Add any template code.
I am adding here simple, text

Add the template as per your requirement


Final step is, let Share know about newly added page.

Create or Edit the file named - web-framework-config-custom.xml in the following folder

Add the following code in the file web-framework-config-custom.xml


   <config evaluator="string-compare" condition="SitePages" replace="true">
      <page id="helloPage">helloPage</page>

To test the page

Restart the Tomcat(your application server)

Login in to your Share (http://localhost:8080/share/)

Go to the created site,
Click on Customize Site, --> Add Pages
Here you should find our newly created page named  Hello Page.  Add that Page.

In the Top navigation, you should find the new page.

1 comment:

  1. I think that I would prefer that these administrative tasks be broken out into their own menu, but this layout is still workable given the current set of features in Share.

    alfresco workflow