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!

Thanks,

Shawn

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" |(user)zbynekh|(hash)25f429016c423eca78541713b2a68b41ce6191d21cfdd7fcf12881e3b251fefd%}
Visible: {% CurrentDocument.DocumentName == "b" |(user)zbynekh|(hash)8bff5993711aaa3e432b30b4395a1d55e9c94fdd31323a4da407b5f44935f2d4%}

Visible: {% CurrentDocument.NodeAliasPath == "/parentpage/b" |(user)zbynekh|(hash)8e5c1937691b16305c630990217422cb8f2a460c1d92a0ab329865757c70d10a%}
Visible: {% CurrentDocument.NodeAliasPath == "/parentpage/a" |(user)zbynekh|(hash)d3911fae2734a06b73b38c7a7f6084594d8d95f33e205418c70ac5b60cacd25d%}


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.

Cheers!

Shawn

0 votesVote for this answer Mark as a Correct answer

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