문제

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.

도움이 되었습니까?

해결책 2

Use following macro:

{% GlobalObjects.Tags.Where("TagID = " + ToInt(QueryString.GetValue("tagid", 0))) %}

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top