Using Plone 4.3.x
Basically: How can I copy one set of elements from the content to place a and place b in a theme and in place b change an attribute of the copied elements?
Specifically: In my rules.xml file I am <replace>
ing two .replace-main-nav
in the theme.html with the children of #navigation
from the content:
rules.xml:
<replace css:theme=".replace-main-nav"
css:content-children="#navigation" />
examples of places in theme.html:
<div class="place-a">
<del class="replace-main-nav"><!-- place nav here --></del>
</div>
<div class="place-b">
<del class="replace-main-nav"><!-- place nav here again --></del>
</div>
example of nav in content
<div id="navigation">
<ul>
<li class="foo">
Item 1
</li>
<li class="foo">
Item 2
</li>
<li class="foo">
Item 3
</li>
</ul>
</div>
I want to replace the attribute class="foo"
with class="baa"
ONLY when the <ul>
replaces .replace-main-nav
in .place-b
.
Is this possible?
If so how can I do it?
What I want out
<div class="place-a">
<ul>
<li class="foo">
Item 1
</li>
<li class="foo">
Item 2
</li>
<li class="foo">
Item 3
</li>
</ul>
</div>
<div class="place-b">
<ul>
<li class="baa">
Item 1
</li>
<li class="baa">
Item 2
</li>
<li class="baa">
Item 3
</li>
</ul>
</div>
Perhaps this helps?
So something like this? (which is not tested)
<replace css:content-children=".place-b">
<ul>
<xsl:for-each select="//*[@id='navigation']/*">
<li class="baa">
<xsl:copy-of select="./text()" />
</li>
</xsl:for-each>
</ul>
</replace>