Hi,
I am trying to find a way to add an if statement to the "main layout" of a space, under site layouts, that checks if a user is a part of a group 'xxx' and if the current pageid == 'yyy'
I am able to do this through a user macro, that I can add to a page - I would just prefer not having to add that user macro to EVERY page I'd like this functionality on.
The problem is, when I add the pageid part of the usermacro to the "mainlayout" then it dont do anything.
Anyone has an idea of how to solve this?
Thanks!
Look and feel - Layout - Main layout:
This if statement is working:
#if(${action.authenticatedUser} && ${userAccessor.hasMembership('xxx', ${action.authenticatedUser.name})})
<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#quick-create-page-button').remove();
AJS.$('#create-page-button').remove();
});
</script>
#else
#end
User macro that works as intended:
@noparam
#if(${action.authenticatedUser} && ${userAccessor.hasMembership('xxx', ${action.authenticatedUser.name})} && $content.getId() == 'yyy' || $content.getId() == 'yyyy')
<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#quick-create-page-button').remove();
AJS.$('#create-page-button').remove();
});
</script>
#else
#end