For my website, I have used the tag control so I can assign tags to my news posts. All fine and dandy so far. Now, when displaying them, I want to make the tags clickable so the user can immediatly filter for other posts with said tag.
So, I split my tag list and put it in a xslt variable:
It technically works. In the post that has 2 tags, it displays 2 values. The thing is, they are the same value, while they should be 2 different values. I am probably missing something that needs to be placed behind the /value in the value-of statement, but I have tried a dozen different things by now and it's starting to drive me nuts.
Alright, it seems that in my attempts to get it working, I changed the split function. After changing that back, Ali Taheri's solutions do infact work, both actually. My bad. If someone could explain why you have to use the "." though, that would be awesome.
The '.' refers to the current item, it is the same as using current(). When you are looping through the items you are in your (Ali's) code actually looping through the values of the items, that's why you just have to get the value by using '.'.
Hmm, that's a bit odd since I had actually tried current() but that didn't seem to be working. Oh well, probably had something else wrong at that point then. Thanks anyway :)
Looping through xslt split array
Okay, new problem :)
For my website, I have used the tag control so I can assign tags to my news posts. All fine and dandy so far. Now, when displaying them, I want to make the tags clickable so the user can immediatly filter for other posts with said tag.
So, I split my tag list and put it in a xslt variable:
I pass this data to a new template part:
And then with a for each, I try to get each seperate item.
It technically works. In the post that has 2 tags, it displays 2 values. The thing is, they are the same value, while they should be 2 different values. I am probably missing something that needs to be placed behind the /value in the value-of statement, but I have tried a dozen different things by now and it's starting to drive me nuts.
Any help would be appreciated.
-Ferdy
try this
Ali
Thanks for the attempt, but that gives me nothing at all I'm afraid :(
how about this?
<xsl:value-of select="$tag" />
Nope, still nothing
Hi Ferdy,
try this out:
To have a look what the content of $tags is you could use
Cheers,
Sascha
Alright, it seems that in my attempts to get it working, I changed the split function. After changing that back, Ali Taheri's solutions do infact work, both actually. My bad. If someone could explain why you have to use the "." though, that would be awesome.
Also, thanks for the help anyway Sascha :)
-Ferdy
Hi Ferdy,
The '.' refers to the current item, it is the same as using current(). When you are looping through the items you are in your (Ali's) code actually looping through the values of the items, that's why you just have to get the value by using '.'.
Sascha
Hmm, that's a bit odd since I had actually tried current() but that didn't seem to be working. Oh well, probably had something else wrong at that point then. Thanks anyway :)
is working on a reply...