By editing the 'Main Layout' decorator, I would like to include the 'show-if' macro (part of the Visibility plugin).
Is it possible? If so, what is the correct syntax?
I've tried this but it does not work:
#{show-if:[scope:french_menu>descendents]}
<div id="custom-top-menu">
<nav><ul> ... </ul></nav>
</div>
#{show-if}
Community moderators have prevented the ability to post new answers.
Here is a snippet code that works:
$helper.renderConfluenceMacro('{show-if:match=any|user=userid}
{html}
<div>your content...</div>
{html}
{show-if}')
However, it no longer works if I add the 'scope' parameter, like:
$helper.renderConfluenceMacro('{show-if:match=any|user=userid|scope=pagetitle}
{html}
<div>your content...</div>
{html}
{show-if}')
Maybe you shouldn't write it in wiki markup but in the storage format.
I don't know exactly, how it looks like cause I don't use this plugin, but if you include this macro on a page and open the "view storage format"-option in the dropdown menu, you can see how the macro is stored in XHTML.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Marcel Woschek for your feedback.
The macro XHTML is:
<ac:structured-macro ac:name="hide-if"><ac:parameter ac:name="scope">french_menu>descendents</ac:parameter>
So, what would be the equivalent in the decorator code editor? Unsurprisingly, a simple copy-paste does not work...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.