AnsweredAssumed Answered

Templating best practices

Question asked by tonizz on Oct 26, 2007
Hi everybody,

Im using WCM for a portal. This portal has 3 main parts.The first one is the frame code with the logos, the menu, and all the common elements for the whole portal. Depending of the choosen option of the menu, I include in the template the correct submenu and content. So I have a common code for all my templates and a variable code.

Right now, I have a different web form for each element of the menu, so when alfresco renders the template knows which "subtemplates" has to include for the submenu and the content.

Each of my web forms has 4 files:

   - General.ftl
   - Content.ftl
   - Submenu.ftl
   - form.xsd (schema information)

This four files are rendered and published as a file output.jsp with all the contents.

I have about 20 web forms. So when i want to change the main Template: general.ftl i have to change all the general.ftl files in the web forms. There isnt a way of having this common template in a unique places and accessible from all the web forms??

I dont know if my problem is that I havent made a good design but I think that the structure is common for a usual portal.

The solution I have though is to have the General.ftl in Web Forms/ directory and each template of the rendition can include it:

so now:

my web form/General.ftl has now this code, its pointing to the real file allocated in the parent folder:

<#include "../General.ftl" parse="true">

I have tried it but alfresco doesn´t find the file general. the route "../General.ftl" is may not be good. So do you know how can I access to this document?????

if it works I have a solution for my problem.

Thanks in advance!