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
Hello,
I have created a new Data Type that is a dropdown menu.
It has a series of options with values
Option 1 (value is 205)
Option 2 (value is 206)
There will be a number of content nodes assigned with a certain value (say 205)
How do i display a list of the content nodes with a certain value?
Any help or guidance will be greatly appreciated.
Thank you
G
<xsl:for-each select="$currentpage/descendant::* [theAliasForTheDropdown = "205"]> <xsl:value-of select="@nodeName"/> </xsl:for-each>
Is this what you're searching for?
Thanks for the reply but adding that doesn't seem to work. This is my xslt which works by displaying a list of nodes with a certain template Id
<xsl:variable name="orgNode" select="umbraco.library:GetXmlNodeById(4257)"/> <xsl:variable name="templateID" select="4841" /> <strong>Find organisation alphabetically</strong><br /><br /> <xsl:for-each select="$orgNode/*[@isDoc][@template = $templateID]"> <xsl:sort select="@nodeName" data-type="text" order="ascending"/> <a href="{umbraco.library:NiceUrl(@id)}" style="float:left; margin: 0 20px 10px 0;"> <xsl:if test="not(*[@isDoc])"> <xsl:attribute name="style">color:#ccc;float:left; margin: 0 20px 10px 0;cursor:text;</xsl:attribute><xsl:attribute name="href">#</xsl:attribute> </xsl:if> <xsl:value-of select="@nodeName"/> </a> </xsl:for-each>
In this instance i only want the list to display nodes with a value that is selected by the drop down menu (alias "portalOrgType")
Okay, I think this will help:
<xsl:variable name="desiredOrgType" select="205"/> <xsl:for-each select="$orgNode/*[@isDoc and @template = $templateID and portalOrgType = $desiredOrgType]"> <xsl:sort select="@nodeName" data-type="text" order="ascending"/> <a href="{umbraco.library:NiceUrl(@id)}" style="float:left; margin: 0 20px 10px 0;"> <xsl:if test="not(*[@isDoc])"> <xsl:attribute name="style">color:#ccc;float:left; margin: 0 20px 10px 0;cursor:text;</xsl:attribute> <xsl:attribute name="href">#</xsl:attribute> </xsl:if> <xsl:value-of select="@nodeName"/> </a> </xsl:for-each>
I've made an attribute for you, where you can type in the value of the desired Organisation type :)
Hi Kim,
Still no joy with this either I'm afraid. Thanks for trying to help though.
Gary
Hi again Gary,
When you make your options for your dropdown datatype - there are two columns. Text and Value. Instead of using the value from the Value column, use the value from the Text column.
so your variable instead will look like this:
<xsl:variable name="desiredOrgType" select="office"/>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Only show node if value =
Hello,
I have created a new Data Type that is a dropdown menu.
It has a series of options with values
Option 1 (value is 205)
Option 2 (value is 206)
There will be a number of content nodes assigned with a certain value (say 205)
How do i display a list of the content nodes with a certain value?
Any help or guidance will be greatly appreciated.
Thank you
G
Is this what you're searching for?
Thanks for the reply but adding that doesn't seem to work. This is my xslt which works by displaying a list of nodes with a certain template Id
In this instance i only want the list to display nodes with a value that is selected by the drop down menu (alias "portalOrgType")
Okay, I think this will help:
I've made an attribute for you, where you can type in the value of the desired Organisation type :)
Hi Kim,
Still no joy with this either I'm afraid. Thanks for trying to help though.
Gary
Hi again Gary,
When you make your options for your dropdown datatype - there are two columns. Text and Value. Instead of using the value from the Value column, use the value from the Text column.
so your variable instead will look like this:
is working on a reply...