cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <andr...@apache.org>
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>
     <map:when test="location-blue">
       <map:generate src="cocoon:/subsitemap-folderB/0000FF"/>
     </map:when>
   </map:select>
</map:match>

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


Sub Sitemap:

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


-- Andreas

-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message