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.
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 ;-)
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.
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
Extending the xslt to pull an image reference
Hi,
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.
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!
Hi Thom,
If you need the introImage property from the page referenced by @link, you only need:
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.
Regards,
/Dirk
Thanks for both of your help! Dirk, that did the trick. Everything working now..
is working on a reply...