Interesting. Our sitemap funnels most everything through this pipeline.

<map:match pattern="layout/**">
  <map:act type="auth-protect">
    <map:parameter name="handler" value="authenticate"/>
      <map:aggregate element="results">
        <map:part element="content" src="cocoon://base/{../1}"/>
        <map:part element="marketing" src="cocoon:/marketing"/>
        <map:part element="user-info" src="cocoon:/user-info"/>
        <map:part element="nav" src="cocoon:/navbar"/>
        <map:part element="secondary-nav" src="cocoon:/second-nav"/>
        <map:part element="header-nav" src="cocoon:/utility-nav"/>        
        <map:part element="footer-nav" src="cocoon:/footer-navbar"/>
        <map:part element="layout" src="cocoon:/gen-layout"/>
      </map:aggregate>
      <map:transform src="Stylesheets/insertIntoLayoutTemplate.xsl"/>
      <map:transform type="i18n">
        <map:parameter name="locale" value="en"/>
      </map:transform>
      <map:transform type="jx"/>
      <map:serialize type="html"/>
    </map:act>
  </map:match>

-----Original Message-----
From: Marco Rolappe [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 08, 2004 3:54 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: AW: Best Way to Build a "Traditional" Website Structure Using
Cocoon?

hi david,

that approach reminds me of JSP templates
(http://www.javaworld.com/javaworld/jw-12-2001/jw-1228-jsptemplate.html)...

and I'd realize that approach something like the following:

- define your template markup
    - including placeholders for sections/regions
- define an aggregation stylesheet
    - receives as parameters the URLs of the defined sections/regions
    - using the parameters, replaces the placeholders in the template with
tags for one of the include transformers
- have an include transformer aggregate the page


sitemap snippet would look like:

...
    <map:match pattern="*.xhtml">
        <map:generate src="template.xhtml"/>

        <map:transform src="template.xsl">
                <map:parameter name="header"
value="cocoon:/header.xhtml.fragment"/>
                <map:parameter name="footer"
value="cocoon:/footer.xhtml.fragment"/>
                <map:parameter name="content"
value="cocoon:/{1}.xhtml.fragment"/>
        </map:transform>

        <map:transform type="cinclude"/>

        <map:serialize type="xhtml"/>
    </map:match>
...


and aggregation stylesheet:

...
<xsl:param name="content"/>

<xsl:template match="content">
        <ci:include .../>
</xsl:template>
...

> -----Ursprungliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag
> von David Swearingen
> Gesendet: Freitag, 9. April 2004 00:04
> An: [EMAIL PROTECTED]
> Betreff: Best Way to Build a "Traditional" Website Structure Using
> Cocoon?
>
>
> Newbie question:  I am designing a dynamic website and have chosen
> Cocoon as the architecture.  The website will contain a 'classic'
> structure, with left navigation, masthead, footer, and a body section
> containing content.  The various elements, like the navigation,
> surrounding the content will rarely change of course.  I will define
> these in XML.  So there will be a leftnav.xml, masthead.xml,
> footer.xml.  In a typical website like this the whole thing is in an
> html table, and the top row of the table contains the masthead, a left
> cell contains the navigation, the right cell contains the body text,
> and the bottom row contains the footer.  Very straightforward, done all
> the time.  I've built numerous sites like this with Struts and other
> tools.
>
> Now imagine the request comes for a page, like faq.html.  I know how to
> make Cocoon grab faq.xml and run it through a XSL transformer to add
> the html markup and then serialize it out.  Done this already.
>
> But for my website I need to generate the entire table context for the
> page, then insert the masthead html, then there's more html that closes
> the table cell and opens a new one, generates the left navigation html
> from leftnav.xml, closes the cell, spits out my content from faq.xml,
> etc., you get the picture.
>
> Ideally I want my page structure html -- the code that defines the
> overall page table that holds all the elements -- in one file, and the
> masthead, navigation and footer in their own files, and then of course
> the content documents are in their respective xml files.  This makes
> for easy site maintenance.
>
> So what's the best way to do this in Cocoon?  It seems it could be
> accomplished in numerous ways, but I have a feeling there's a
> best-practice here.
>
> Thanks,
> David
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway
> http://promotions.yahoo.com/design_giveaway/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to