<MythQuestion id="1163" parentID="1154" level="4" writerID="0" creatorID="0" nodeType="1162" template="0" sortOrder="4" createDate="2011-02-24T09:12:37" updateDate="2011-02-24T09:14:07" nodeName="Question1" urlName="question1" writerName="Administrator" creatorName="Administrator" path="-1,1053,1107,1154,1163" isDoc=""> <question><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed purus ac eros feugiat bibendum. Donec eget dui eget mi dignissim vulputate non vitae nisi. Mauris dui diam, hendrerit ut facilisis vel, fermentum et lectus.?]]></question> <answer><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed purus ac eros feugiat bibendum. Donec eget dui eget mi dignissim vulputate non vitae nisi. Mauris dui diam, hendrerit ut facilisis vel, fermentum et lectus.!]]></answer> <relatedLinks> <links> <link title="Link1" link="1129" type="internal" newwindow="0" /> </links> </relatedLinks> <umbracoNaviHide>0</umbracoNaviHide> </MythQuestion>
trouble with relatedLinks datatype
I have a documentType with a property of type RelatedLink. I cant output the link in my XSLT.
Im using Umbraco v 4.5.2
DocumentType contains Question (Text), Answer (Text), RelatedLinks (relatedlinks)
question and answer outputs fine...
My XSLT:
<div id="mythQuestions">
<xsl:for-each select="$currentPage/* [name() = $documentTypeAlias and string(umbracoNaviHide) != '1']">
<div id="mythQ" style="padding:5px; border:solid 1px #cdcdcd; width:170px;">
<xsl:value-of select="question"/>
</div>
<div id="mythA" style="padding:5px; border:solid 1px #cdcdcd; width:170px;">
<xsl:value-of select="answer"/>
<div id="mythALinks">
<xsl:value-of select="relatedLinks"/>
</div>
</div>
</xsl:for-each>
</div>
From my Umbraco.config
<MythQuestion id="1163" parentID="1154" level="4" writerID="0" creatorID="0" nodeType="1162" template="0" sortOrder="4" createDate="2011-02-24T09:12:37" updateDate="2011-02-24T09:14:07" nodeName="Question1" urlName="question1" writerName="Administrator" creatorName="Administrator" path="-1,1053,1107,1154,1163" isDoc="">
<question><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed purus ac eros feugiat bibendum. Donec eget dui eget mi dignissim vulputate non vitae nisi. Mauris dui diam, hendrerit ut facilisis vel, fermentum et lectus.?]]></question>
<answer><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed purus ac eros feugiat bibendum. Donec eget dui eget mi dignissim vulputate non vitae nisi. Mauris dui diam, hendrerit ut facilisis vel, fermentum et lectus.!]]></answer>
<relatedLinks>
<links>
<link title="Link1" link="1129" type="internal" newwindow="0" />
</links>
</relatedLinks>
<umbracoNaviHide>0</umbracoNaviHide>
</MythQuestion>
You need to select all of the links, even if there's only one, something like this should work:
is working on a reply...