Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How would I show an include or some controls only if a label is present on that page?

Martin Cleaver
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2013

I have some pages, where I denote the type of the page using a label. (e.g. 'marketing')

On each of those labeled / typed pages, I want to show an {include} that brings in extra information .

How would I do this?

We are using Confluence 5.3.1

Thanks, M.

2 answers

1 accepted

0 votes
Answer accepted
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2013

You could use the "if-label" user macro, which can be found here:

https://confluence.atlassian.com/display/DISC/if-label

NOTE: Ignore step 7.

I haven't tested it myself, but it should work.

Martin Cleaver
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2013

Thanks Stephen.

Yes, it worked, with a couple of tweaks! I've posted my replacement version to the page you pointed me to.

Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2013

Glad to hear it worked for you, and thanks for the update! I think a lot of people don't consider how powerful the user macro functionality is, and unfortunately many of the user macros on the shared page don't work so well anymore (not to mention that the full documenation for user macros is pretty sparse).

0 votes
Christina Stergiou May 14, 2014

Hello,

I would love to have the opportunity to use more than one label within the macro. Currently I give out a status macro named Draft to my page whenever there is a draft-label attached to the site.

It would be great If I could add some more statuses like Approved, Reviewed etc. Unfortunately I'm absolutely in lack of experience in order to rewrite my own version of this macro.

Maybe someone can think of a solution and give me a hint?

Best regards!

Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2014

Why not just include multiple versions of the same macro in the page? You can choose any label in the options. If the label doesn't exist, they don't take up any space on the final page anyways. Or perhaps I didn't understand your use case.

Christina Stergiou May 14, 2014

Hey Stephen,

thanks for your fast reply. Of course that is a possible solution BUT I would prefer having less macros (best just one) on my pages. I have some late adopters in the team I currently work for and they can be easily scared away by having too much stuff they do not understand (yet).

I know this is quite a "first world problem" so I guess I will give your suggestion a try and see how it is going with the team. Thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events