cancel
Showing results for 
Search instead for 
Did you mean: 

how to add a custom site page in share 4.0.d

pmrreddy
Champ on-the-rise
Champ on-the-rise
Hi all

i am using share 4.0.d(Community Edition), i want to add a custom page for my site . can anyone help me
with steps to add a custom site page in 4.
thanx in advance

Regards
Pmrreddy
2 REPLIES 2

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
Easiest way to extend is to place your files below <tomcat-dir>/shared/classes/alfresco/web-extension or <tomcat-dir>/webapps/share/WEB-INF/classes/alfresco/web-extension directory. Use the same directory structure as in the parent classes/alfresco, so create a 'messages', 'site-data', 'site-webscripts' and 'templates' folder in this location.

Now you create the following files to define a new page (look for examples to similar files in share webapp):

- create a freemarker template my-page.ftl in templates/com/yourcompany
Here you define the html structure of the page and regions to which you can bind components/webscripts that render content. Look for an example at documentlibrary.ftl

- create a template instance my-page.xml in site-data/template-instances
The template-type element should refer to freemarker template (com/yourcompany/my-page). Add components that bind a certain webscript (based on url) to regions defined in your freemarker template.

- create a my-page.xml in site-data/pages
This is the actual page declaration. The template-instance element is my-page. You can choose an authentication level (none, user, admin) as well.

- create a presets.xml in site-data/presets
Look at presets.xml that exists share/WEB-INF/classes/alfresco/site-data/presets and copy the 'site-dashboard' section to your own presets.xml.
Add your page to the preset:
<sitePages>[{"pageId":"my-page"}]</sitePages>

- create a share-config-custom.xml in the root of web-extension dir
Copy the SitePages section from share/WEB-INF/classes/alfresco/share-config.xml into this file and edit as follows:
   <config evaluator="string-compare" condition="SitePages">
      <pages>
         <page id="my-page">my-page</page>
      </pages>
   </config>

The page is yours!