Hide a macro for a specific page that's been added in the space layout

Alexander Yolov August 22, 2018

If I add a macro through the space layout, so that all pages within the space have it, is there a way to specify only some pages that won't have it? I imagine it would be easier to add the macro 'globally' in this way and only manually hide it for some pages, instead of adding it to all pages.

So far, I've used HideElements and the css selector, but I was wondering if there's another way?

 

Thanks in advance,

Alex

1 answer

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 5, 2018

Hello Alexander!
Well, you are right. Usually this should be done with CSS customization. I understand you already have a solution for that, but here is our documentation:

- How to hide elements in Confluence using CSS or JavaScript

Also, would you be able to share with us your custom solution for this situation? This could aid other customers with the same situation!
Now, looking at our Marketplace I have found this plugin:

- Visibility for Confluence

This plugin could help you to achieve the desired results.
Let us know if you solve this!

Alexander Yolov September 5, 2018

Hey and thanks for the answer.

My current solution is in my first post - I've added a macro to all pages in a space 'globally' by adding it to the page header/body/footer (as needed) using the 'space layout' control - this practically adds it to every page's header (for example) in a space. Then on specific pages where I don't want the macro to show - I'm using the 'hide elements' macro to specify a css selector: https://marketplace.atlassian.com/apps/1211757/hideelements-for-confluence?hosting=server&tab=overview - this saves me a lot of time as I'm adding something 'globally', then 'hiding' it from the handful of pages where it's not needed.

As for 'visibility to confluence' - it didn't seem like the most suitable thing for me, as I don't want to restrict access to user(s)/group(s), but for all and any users and groups at the same time.

The specific task I'm doing is - I wrote a custom floating page contents menu to replace my old static table-of-contents and I did it as a user macro. The easiest way to add it to new spaces 'globally' (i.e. to all pages in a space, even newly created ones) seemed to be adding the macro to the page header via the space layout. Then I have the home page where I don't want any menus whatsoever - so I'm just adding a 'hide elements' macro manually to the home page and specifying the css selector for my custom user macro and that's it.

Alex

Alexander Yolov September 5, 2018

I was just wondering if anyone knows of a 'better' way that's considered 'good practice'.

Alex

 

P.S. if you think it's going to be useful - I can add some steps and screenshots to describe my workflow.

Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2018

Hello Alexander!

Since it is a customization, there is not a strictly better way of doing. There are other ways of course, such as the macro.

You just need to be careful and check if the code you created does not affect other parts of Confluence usage.

If you can share your steps and screenshots for this procedure, you would surely help others in similar situations!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events