First of all, I'm surprised you are getting the correct text, given your for-each is only looping through the first sub level of the current page.
Secondly, if the syntax for getting the text does in fact work, why don't you just duplicate for the image? So replace $currentPage/*/productPicture with just productPicture ?
What I would have thought you would want is to change your loop to use the all descendants axis:
<xsl:for-eachselect="$currentPage//*[@isDoc and string(umbracoNaviHide) != '1']">
...which will make the current element in each pass of the loop the child page, at whatever level, so you can just use productTitle, productText and productPicture.
Childnote img and RTE
At the moment im working with a macro that gathers the RTE and IMG from all childnotes
The code goes like this:
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<!--
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
-->
<div id="buyProduct">
<div id="buyImage">
<xsl:if test="$currentPage/*/productPicture != ''">
<img src="{umbraco.library:GetMedia($currentPage/*/productPicture,0)/umbracoFile}" />
</xsl:if>
</div>
<div id="buyText">
<h2><span class="grey"><xsl:value-of select="productTitle" disable-output-escaping="yes"/></span></h2>
<xsl:value-of select="productText" disable-output-escaping="yes"/>
</div>
<div id="clear"></div>
</div>
An error accures regarding the gathering of the productPicture
<div id="buyImage">
<xsl:if test="$currentPage/*/productPicture != ''">
<img src="{umbraco.library:GetMedia($currentPage/*/productPicture,0)/umbracoFile}" />
</xsl:if>
</div>
For each child note i get the correct RTE data, but i get the picture from the first childnote for each childnote.
And OFC what i want is to display the productPicture from each childnote, and not just the same IMG on every post.
Hope someone can help.
First of all, I'm surprised you are getting the correct text, given your for-each is only looping through the first sub level of the current page.
Secondly, if the syntax for getting the text does in fact work, why don't you just duplicate for the image? So replace $currentPage/*/productPicture with just productPicture ?
What I would have thought you would want is to change your loop to use the all descendants axis:
<xsl:for-each select="$currentPage//*[@isDoc and string(umbracoNaviHide) != '1']">
...which will make the current element in each pass of the loop the child page, at whatever level, so you can just use productTitle, productText and productPicture.
Man that worked... im new at this, so sometimes i cant always figure it out.
Thanks alot.
Awesome, glad it worked!
is working on a reply...