You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Pratik Das <Pr...@skytechsolutions.co.in> on 2004/08/16 07:16:07 UTC

Deriving templates

I am very new to Lenya. I will be grateful if anyone can throw some light 
on my problem. I am trying to build a template based website. I want to 
define xsl files corresponding to each template. The user should have the 
capability to choose a template while creating pages. Right now he says 
the page2xhtml template for all pages. 
Also is it possible to make the templates derivable from each other. Say a 
base template containing header and footer and editable regions for body 
and side bar. The page2xhtml contains a template cmsbody where all the 
body content goes. If I want to override, i have to overrride the entire 
cmsbody which will also override the header and footer. Is there any way 
to break up the cmsbody template into multiple templates for header, 
footer and body so that the header and footer are part of base template 
and only the body and side bar are overriden.
Thanks in advance
Pratik

Re: Deriving templates

Posted by Pratik Das <Pr...@skytechsolutions.co.in>.
I managed to solve this. I have created multiple templates deriving from a 
single base template. Now my problem is using different templates based on 
different urls. I am defining my pipelines in publication-sitemap giving 
match as **/RFI*.* as given below. By this I want all documents whose name 
starts with RFI to use jobFormTemplate. Similarly I have defined other 
templates which I want to pick up based on document names. But somehow 
only one template is getting called and rest are ignored. Can anyone help 
me out with this. Thanks in advance. 
Pratik
    <map:pipeline>
      <map:match pattern="lenyabody-**/RFI*.*">
        <map:aggregate element="cmsbody">
          <map:part src="cocoon://navigation/{2}/{3}/breadcrumb/{5}.xml"/>
          <map:part 
src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}"/>
        </map:aggregate>
        <map:transform src="xslt/jobFormTemplate.xsl">
          <map:parameter name="root" 
value="{page-envelope:context-prefix}/{2}/{3}"/>
        </map:transform>
.....
....
        <map:serialize type="xml"/>
      </map:match>

    </map:pipeline>



Pratik Das <Pr...@skytechsolutions.co.in> 
08/16/2004 10:46 AM
Please respond to
"Lenya Users List" <le...@cocoon.apache.org>


To
lenya-user@cocoon.apache.org
cc

Subject
Deriving templates







I am very new to Lenya. I will be grateful if anyone can throw some light 
on my problem. I am trying to build a template based website. I want to 
define xsl files corresponding to each template. The user should have the 
capability to choose a template while creating pages. Right now he says 
the page2xhtml template for all pages. 
Also is it possible to make the templates derivable from each other. Say a 
base template containing header and footer and editable regions for body 
and side bar. The page2xhtml contains a template cmsbody where all the 
body content goes. If I want to override, i have to overrride the entire 
cmsbody which will also override the header and footer. Is there any way 
to break up the cmsbody template into multiple templates for header, 
footer and body so that the header and footer are part of base template 
and only the body and side bar are overriden. 
Thanks in advance 
Pratik