cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <>
Subject Re: Passing "parameters" to mounted sub-sitemaps
Date Thu, 26 Feb 2009 09:42:55 GMT
Hi Klortho,

Klortho schrieb:
> I'm sure this is a dumb question, but I'm kind of a newbie, and have just
> spent hours looking for the answer in various books, and searching this
> forum, and can't find it.
> I'm trying to vary the look of my final output depending on where the source
> files are stored.  I have a resource-exists selector that decides whether to
> mount a sub-sitemap from one location or another.  Then, I want to pass
> something down to the sub-sitemap so that it can pass it along to the
> stylesheets, so that I can get a different background color depending on the
> source tree's physical location.
> I tried pretty brain-dead ideas like using <map:parameter name, value> in my
> parent sitemap, and then a parameter selector in the child, but then I read
> that the parameter selector is only for parameters from actions or for url
> segments from matchers.
> Isn't there a canned action that will just let me set a parameter of my
> choosing with a value of my choosing?  Or, what's the right way to do this?

how about something like this?

Main Sitemap:

<map:match pattern="*">
   <map:select … > (location)
     <map:when test="location-red">
       <map:generate src="cocoon:/subsitemap-folderA/FF0000"/>
     <map:when test="location-blue">
       <map:generate src="cocoon:/subsitemap-folderB/0000FF"/>

<map:match pattern="subsitemap-*/*">
   <map:mount uri-prefix="subsitemap-{1}" src="subsites/{1}/sitemap.xmap"/>

Sub Sitemap:

<map:match pattern="*">
   <map:transform src="background.xsl">
     <map:parameter name="color" value="{1}"/>

-- Andreas

Andreas Hartmann, CTO
BeCompany GmbH
Tel.: +41 (0) 43 818 57 01

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message