Mark Handy
Mark Handy

Reputation: 1256

Kentico webpart visibility

i'm trying to hide an editable text webpart if it's empty. Tried some JS methods which aren't elegent (the webpart has a bottom border, so there is a flicker). I then came across this post: Kentico 7 hide editable text if it's empty

Any reason why this won't work in Kentico 9? It's hiding my webpart regardless.

Upvotes: 0

Views: 321

Answers (1)

Brenden Kehren
Brenden Kehren

Reputation: 6117

In v8 and > you want to use the below syntax as the CMSContext.CurrentDocument has been deprecated.

{% (ViewMode != "LiveSite") || (CurrentDocument.editabletext != "") %}

Where you see .editabletext this is the code name of your editable text webpart.

Upvotes: 2

Related Questions