cancel
Showing results for 
Search instead for 
Did you mean: 

Share page with dynamic URL

alejandrogarcia
Champ in-the-making
Champ in-the-making
Hi folks,

I'm wondering if it would possible (I guess yes) to create in Share such a page that has a dynamic URL depending on the site it belongs to, the same way than the pages Blog, Data List do, for instance. Is it possible? How to do it?

I was playing a little, taking as model the Blog page of a site but I didn't success. I have noticed this kind of pages don't have any URL in the page definition. Is there is a place where site pages are declared? Any idea?

I've been searching in the forum, blogs as well as "googling" and I didn't find anything useful…

Thanks in advance.

Regards.
3 REPLIES 3

ddraper
World-Class Innovator
World-Class Innovator
Hi,

We do this via something we call "uri-templates"… if you look in the "share-config.xml" (share/WEB-INF/classes/alfresco) and search for "uri-templates" you'll find the examples that we use for the site pages.

As an example, in the template:
<uri-template id="sitedashboardpage">/site/{site}/dashboard</uri-template>

Any URL that fits the template (e.g. share/page/site/my-site/dashboard) will map to the page. In this example the page id is that complete template (e.g. /site/my-site/dashboard).

For templates that have the "pageid" token, e.g
<uri-template id="sitepage">/site/{site}/{pageid}</uri-template>

Then the "pageid" is used as the ID of the page to look up… so the URL "share/page/site/my-site/documentlibrary" would be matched to the page "documentlibrary" and "my-site" would be set as a URI template argument "site".

Regards,
Dave

alejandrogarcia
Champ in-the-making
Champ in-the-making
Thanks Dave, it is impossible to answer better to my question  :wink:

It seems it is exactly what I was looking for. I'll try it out and I'll let you know.

Regards.

alejandrogarcia
Champ in-the-making
Champ in-the-making
Great, I works just by adding to the share-config.xml file the next code:

<alfresco-config>
   <config evaluator="string-compare" condition="SitePages">
      <pages>
         <page id="test-site-page">test-site-page</page>
      </pages>
   </config>
</alfresco-config>

For those trying to do the same, obviously you have to create the page first. I you don't know how to create a page, the following link explains how to do it easily: http://docs.alfresco.com/4.0/topic/com.alfresco.enterprise.doc/tasks/tutorial-share-add-page.html.

Thanks again Dave.

Regards.