Reputation: 3
I have a tag cloud on product listing pages on my site that goes to a tag results page which displays products that contain that chosen tag. I want to put a header at the top of that results page that says something like "Products Tagged As: (insert tag name here)"
Any advice? I can't seem to access the system variable that displays the currently chosen tag name. The page URL contains the tagID variable, if that helps:
Product-Features.aspx?tagid=36
I am using Portal Engine Kentico development, by the way. Thanks.
Upvotes: 0
Views: 415
Reputation: 34
I know this question has been asked a while ago. But I am posting my answer just in case if anyone come across this question they can use this snippet.
Try using following macro {%tag="";foreach(g IN SiteObjects.TagGroups){foreach(t IN g.Tags){if(t.TagID=ToInt(QueryString.tagid)){tag=t.TagName;}}}return tag;%}
Note: I am using Kentico Version 9.0
For some reason the macro doesnt work in page template directly, I put the above macro in a Static Text webpart its worked like a charm. Hope it would help someone like myself.
Regards,
Gopala
Upvotes: 1
Reputation: 7696
Use following macro:
{% GlobalObjects.Tags.Where("TagID = " + ToInt(QueryString.GetValue("tagid", 0))) %}
Upvotes: 0