I'm trying to get a list of all tags in all subnodes of a particular node. The code I have almost works, but it's duplicating the tags for each of the subnodes. How can I modify this just to pick out the tags once?
Thanks Dan - I'd seen that post, but am not too keen on swapping the tag data types for plain text, as much of the data has already been populated. I tried the solution from Gerty but couldn't get that to work. The code I have above does work, except that it returns the tags for each of the nodes, so they get repeated. I'll try to explain...
My structure is like this:
Home - Gallery -- Gallery item 1 (contains a tag 'field') -- Gallery item 2 (contains a tag 'city') -- Gallery item 3 (contains a tag 'beach')
So what I want to get is a list of all tags under the gallery node (node id 2140). The code above returns them all for each gallery item, so it's returning:
I think it's something to do with the fact that I'm looping through the nodes, and it must be returning the full set of tags for each node, but I'm not able to get it to just get the tags for one of the nodes. I've tried this, but I think my syntax is wrong as it returns nothing:
Get tags from all subnodes of a particular node
Hi,
I'm trying to get a list of all tags in all subnodes of a particular node. The code I have almost works, but it's duplicating the tags for each of the subnodes. How can I modify this just to pick out the tags once?
Thanks all...
Hi Dan
This post should help -> http://our.umbraco.org/forum/developers/xslt/5467-recursively-query-all-Tags-below-a-specific-node?p=1
Dan
Thanks Dan - I'd seen that post, but am not too keen on swapping the tag data types for plain text, as much of the data has already been populated. I tried the solution from Gerty but couldn't get that to work. The code I have above does work, except that it returns the tags for each of the nodes, so they get repeated. I'll try to explain...
My structure is like this:
Home
- Gallery
-- Gallery item 1 (contains a tag 'field')
-- Gallery item 2 (contains a tag 'city')
-- Gallery item 3 (contains a tag 'beach')
So what I want to get is a list of all tags under the gallery node (node id 2140). The code above returns them all for each gallery item, so it's returning:
What I need to return though is just:
I think it's something to do with the fact that I'm looping through the nodes, and it must be returning the full set of tags for each node, but I'm not able to get it to just get the tags for one of the nodes. I've tried this, but I think my syntax is wrong as it returns nothing:
Any ideas, or do I really have to abandon tags completely?
Ah-ha! Got it actually. I found a great blog post on tags.
My working solution assumes that I put all tags under the main node in a certain group, which is doable I think:
is working on a reply...