Display image from defined node using content picker
Hi All,
I'm having a problem displaying content from nodes defined in a content picker.
The content picker chooses a page to link to on the site. On each page there is a an 'upload image' property called pageLinkImage. Each page will have an image assigned to it so that when I want create a link to any page around the site, I don't have to manually upload an image each time.
I have managed to get the link name to display, but I am having trouble getting the image to appear.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " ">]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Examine="urn:Examine"
exclude-result-prefixes="msxml umbraco.library Examine ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the related links property alias here -->
<xsl:template match="/">
<!-- The fun starts here -->
<div class="col-xs-6">
<xsl:if test="number($currentPage/pageLink1) > 0">
<a href="{umbraco.library:NiceUrl($currentPage/pageLink1)}">
<img class="img-responsive" src="{umbraco.library:GetXmlNodeById($currentPage/pageLink1)/data [@alias = 'pageLinkImage']/umbracoFile}"/>
</a>
<a class="textlink" href="{umbraco.library:NiceUrl($currentPage/pageLink1)}">
<h4><xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/pageLink1)/@nodeName"/> ›</h4>
</a>
</xsl:if>
</div>
</xsl:template>
</xsl:stylesheet>
The piece of code that isn't working is this line:
Display image from defined node using content picker
Hi All, I'm having a problem displaying content from nodes defined in a content picker.
The content picker chooses a page to link to on the site. On each page there is a an 'upload image' property called pageLinkImage. Each page will have an image assigned to it so that when I want create a link to any page around the site, I don't have to manually upload an image each time.
I have managed to get the link name to display, but I am having trouble getting the image to appear.
The piece of code that isn't working is this line:
Any help would be appreciated,
Cheers,
Wade.
Ok, I just figured it out myself, so in case anyone is looking to do the same thing... I changed the problem line to this:
Which gives the final code of this:
is working on a reply...