Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8901

Set webpart visibility based on page category in Kentico

$
0
0
I have a page with a static HTML web part and want to set its visibility based on the value of the page category. If the category = "ABC" then make it visible, if not make it invisible. The category value was set through the Properties tab. I've tried these 2 macro below, but both didn't work. Thanks for your help!{%if(CurrentDocument.Categories.DisplayNames=="ABC"){ return true; } else { return false; } #%} or{%if(CurrentDocument.Categories.DisplayNames.Contains("ABC")){ return true; } else { return false; } #%}

Viewing all articles
Browse latest Browse all 8901

Trending Articles