I made an XSLT from changeable source and thus want to pull data from a node but i would like to use a drop down list to that user can choose what they want to view lets say " Categories".
My question is how to i get to populate the data ins a drop down list.
Drop Down List
Hi guys,
I made an XSLT from changeable source and thus want to pull data from a node but i would like to use a drop down list to that user can choose what they want to view lets say " Categories".
My question is how to i get to populate the data ins a drop down list.
Fuji
are you talking about the backend or frontend?
Frontend.....i want to be able to populate the list on my website in a drop down list.
so you want the user to select a category from a list of categories ? correct me if i'm wrong.
Correct....
ok so lets say you are in the page of "categories" and all your child nodes are categories
is that anwser your question?
forgot to mention one thing
I gave this a shot
The drop down is populating the content as well
great :)
Can i ask you why you used this code though??
<xsl:for-each select="$currentPage/Category">
<option value="{@id}"><xsl:value-of select="@nodeName" /></option>
</xsl:for-each>
sure you can,
lets say this is your website
Root
Home
Categories
Category 1
Category 2
Category 3
you are currently on the page of http://nameofwebserver.com/Categories/
the currentPage variable points to "Categories" page
you can use the currentPage variable to populate all the children of "Categories"
if you are on the page http://nameofwebserver.com/
the currentPage variable will point to "Home" node.
Makes sense, thanks Eran
one more important thing to mention
the http:///nameofserver.com points to "Home" node because its the first node.
if you have
Root
Home
Categories
Home2
Categories
the home2 link will be http://www.nameofserver.com/Home2
is working on a reply...