Using a page template for multiple pages

Shawn Ebeyer asked on October 6, 2016 17:40

Hi all,

I'm reusing the same page template for two pages - however I want to be able to hide/show certain web parts. What is the macro syntax for this? And where would I put this? I'm thinking in a WHERE clause that would return a true/false value?

Syntax examples would be amazing as always!



Correct Answer

Joshua Adams answered on October 6, 2016 17:44

In each webpart, you can set a visible macro. Examples could be assuming that your pages are named a and b:

Visible: {% CurrentDocument.DocumentName == "a" %}
Visible: {% CurrentDocument.DocumentName == "b" %}

Visible: {% CurrentDocument.NodeAliasPath == "/parentpage/b" %}
Visible: {% CurrentDocument.NodeAliasPath == "/parentpage/a" %}

There are tons of possiblities.
0 votesVote for this answer Unmark Correct answer

Recent Answers

Shawn Ebeyer answered on October 6, 2016 17:49

Thanks Joshua,

Not using the CMS regularly, I forgot that I can click and expand to add code to the visibility option.



0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.