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
this works great for me but I'm trying to add some further information to the 'a' element. Specifically a class which must include a reference to an image in the media library (this gets used for an image rollover on hovering over the list item). The image required is specified in the target page (@link) in a Media Picker property called introImage.
Having a complete mental block here, any help much appreciated! I'm sure this is going to be dead simple. If more explanation required happy to supply.
</xsl:attribute><xsl:attribute name="class"> <xsl:value-of select="?????????????????????" /></xsl:attribute></xsl:otherwise>....
<xsl:value-of select="umbraco.library:GetMedia(data [@alias = 'introImage'],'false')/data [@alias = 'umbracoFile']"/>
Thanks for the replay skiltz. I now get the "Value was either too large or too small for an Int32" error and think could get round that with an if test. But I wonder if your code is looking in the correct place for the introImage - the property isn't in the $currentPage but in the page referenced by ./@link in the snippet I posted.
Should I get the node id from @link, store it in a parameter and then pass that to GetMedia or can I reference the 'remote' property directly with @link? Either way I'm stuck.
Hope I'm making some sense, reading it back I'm not sure I am ;-)
Try ticking "Skip Testing(ignore errors) at the top of the xslt editor and then view your page to see if the value came through.
no joy. Page is rendered with "Error parsing XSLT file: \xslt\getRelatedLinks.xslt". Even without that ticked I can successfully save the xslt file but visualising xslt raises the error. The xslt seems valid but not retrieving the value I need.
What I'm struggling with is how to reference a property on another page with the @link value from the current page being the only reference I have. The xslt grabs the url fine using this (<xsl:value-of select="umbraco.library:NiceUrl(./@link)"/>) but I'm stuck with the syntax to grab the introImage property of that (@link) page.
Thanks for your help so far!
If you need the introImage property from the page referenced by @link, you only need:
<xsl:value-of select="umbraco.library:GetXmlNodeById(./@link)/data [@alias = 'introImage']" />
you may need to surround this code snippet with an <xsl:if> as './@link' won't have a value until runtime, thus resulting in a "Value was either too large or too small for an Int32" error
Hope this helps.
Thanks for both of your help! Dirk, that did the trick. Everything working now..
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted