Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am working on a portfolio-site, which has the following structure:
category+ project 1 + Image 1 + Image 2+ project 2 ....
I have the following code within my xslt to creat an overview of projects on my category page:
<ul> <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']"> <li><a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </xsl:if> </a></li></xsl:for-each></ul>
What I really would want is to expand this code, so the first image of the first child is shown within the href instead of the nodeName. This way the image of: 'Image 1' is shown as the image for project 1.
The image is called display.
Any help is welcome...
Hi Patrick
Maybe something like the following can help you:
<ul> <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']"> <li><a href="{umbraco.library:NiceUrl(@id)}"> <xsl:if test="./*[@isDoc][1]/display != '' ">
<xsl:variable name="media" select="umbraco.library:GetMedia(./*[@isDoc][1]/display,0)"/>
<img src="$media/umbracoFile" alt="$media/@nodeName" />
</xsl:if> </a></li></xsl:for-each></ul>
/Kim A
Thanks Kim,
You made my day!
Greetings, Patrick
Great! Glad to hear that Patrick :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Structure problem
I am working on a portfolio-site, which has the following structure:
category
+ project 1
+ Image 1
+ Image 2
+ project 2
....
I have the following code within my xslt to creat an overview of projects on my category page:
<ul>
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<li><a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</xsl:if>
</a></li>
</xsl:for-each>
</ul>
What I really would want is to expand this code, so the first image of the first child is shown within the href instead of the nodeName. This way the image of: 'Image 1' is shown as the image for project 1.
The image is called display.
Any help is welcome...
Hi Patrick
Maybe something like the following can help you:
<ul>
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<li><a href="{umbraco.library:NiceUrl(@id)}">
<xsl:if test="./*[@isDoc][1]/display != '' ">
<xsl:variable name="media" select="umbraco.library:GetMedia(./*[@isDoc][1]/display,0)"/>
<img src="$media/umbracoFile" alt="$media/@nodeName" />
</xsl:if>
</a></li>
</xsl:for-each>
</ul>
/Kim A
Thanks Kim,
You made my day!
Greetings, Patrick
Great! Glad to hear that Patrick :)
/Kim A
is working on a reply...