Overview:
The {show-to} macro displays content only to specific users or groups...
There may be times when you want to display content on Pages, News, Comments, the Site Welcome Message and even user profiles only to particular users or groups of users and that's what the {show-to} macro is designed to do.
Such a feature allows you to, for example, personalise your site to display custom content and/or navigation depending on the logged in user.
Parameters:
The {show-to} macro shows it's contents based on various settings:
{show-to:user=users|group=groups|space=spaces|trim=true/false|match=all/any}Any content to be
shown{show-to}
| Parameter | Required | Notes |
|---|---|---|
| user | A list of one or more users to show the content to. | |
| group | A list of one or more user groups to show the content to. | |
| space | If the user has the specified privileges within the spaces listed, the content will be shown. To add a privilege to a specific space, use "SpaceKey:Privilege". Valid privileges are:
|
|
| match | By default, if any of the criteria match the logged in user, the content will be shown. However, if you set this parameter to all then every single criteria will have to match before the content will be shown. |
This macro should only be used as a simple way to personalise content depending on the logged in user and optionally any space-specific privileges they may have.
This macro should not be used as a security mechanism. While it will only show content in specific circumstances when used normally, the content will still be indexed by the search engine and features such as Page Source will still display the content, regardless of the way you use this macro.
Do not use this macro to hide confidential or sensitive information because the content will still be visible via some views or features of the software.
Examples:
Hints and Tips
When showing content to specific users or groups, etc., remember that logged out users will be not be recognised (either by user name, group or space privileges).
You could create an "advanced-users" group in order to show more advanced information to users in that group.
Frequently Asked Questions
| Q | Rather than showing content from specific users, etc., I want to hide it from them - how? |
|---|---|
| A | Use the hide-from macro. |









Comments (16)
Oct 02, 2006
Anonymous says:
In Example 3 the macro ie and the end rather than By the way I tried to le...In Example 3 the macro
ie and the end rather than
By the way I tried to leave this comment as a logged in user but the comment link at the end of the page is only visible when I am an anonyous user.
Tim Baker
INSIDE Contactless
Oct 02, 2006
Anonymous says:
I should have used the escape character Here we go again In Example 3 {show-t...I should have used the escape character
Here we go again
In Example 3
{show-to:space=Intranet:edit}*Please edit the relevant page in the Intranet.*{hide-from}
Should read
{show-to:space=Intranet:edit}*Please edit the relevant page in the Intranet.*{show-to}
show-to rather than hide-from at the end
Comment link to post comments only appears before sign in, when I am anonymous!!
Oct 02, 2006
Tim Baker (In-Club) says:
The link to "Confluence Extensions page" in the "Availability" tab is broken (be...The link to "Confluence Extensions page" in the "Availability" tab is broken (be recoverable) and should be directed to :
http://www.randombits.org/display/CONF/Visibility+Plugin#VisibilityPlugin-Downloads
Dec 20, 2006
Anonymous says:
Are there problems with nested show-tos?Are there problems with nested show-tos?
Dec 21, 2006
Dan Hardiker says:
As macros don't have open / close markers, the same tag is reused, then you cann...As macros don't have open / close markers, the same tag is reused, then you cannot nest any macros as the following:
{div} A {div} B {div} C {div}Doesn't know if it's output should be:
or
So it assumes the latter, meaning you cannot nest.
Dec 21, 2006
Guy Fraser says:
That's a general problem with all Confluence macros. Because there is no clear d...That's a general problem with all Confluence macros. Because there is no clear distinction between an opening and closing tag in Confluence macros, any nesting causes lots of problems.
For example, look at this HTML:
It's obvious that you have two seperate div tags and the one that contains "fish" is inside the outer div. But look what happens when you use wiki notation:
{div}{div}fish{div}{div}Because the start and end tags are the same, your divs aren't nested any more
Whereas "fish" was inside a nested div tag in the HTML example, with wiki notation it's not even inside a single div tag in the example shown!
For some macros, plugin authors duplicate up - so for div macros we've made div2, div3, ... div9. However, for things like show-to, there aren't any aliases that can be used.
One technique we use a lot is to use show-to and hide-from macros together - it's not ideal but allows most scenarios to be accomodated.
It's our understanding that at some point Atlassian may update the rendering engine to allow closing macro tags to be more clearly defined, but that probably won't happen for at least another 6-12 months.
Feb 05, 2007
Anonymous says:
1) could not access the JIRA link above for issue tracking 2) suggest you add a...1) could not access the JIRA link above for issue tracking
2) suggest you add a feature for {show-to:anonymous} or {show-to:authenticated-users}. Currently, with LDAP or other federated authentication schemes (which don't use the default confluence group confluence-users) the trick you suggest does not allow easy hiding/showing of content based on if a user is named or anonymous.
Nov 15, 2007
James Mortimer says:
show-to and hide-from 'users=' parameter now supports @anonymous and @authenti...only show to not logged-in users
see http://jira.adaptavist.com/browse/VISIB-22
Jul 05, 2008
Chris Mitchell says:
Where can I find the guide on how to create user groups?Where can I find the guide on how to create user groups?
Jul 05, 2008
Guy Fraser says:
Go in to the Confluence administration console then scroll down to bottom of the...Go in to the Confluence administration console then scroll down to bottom of the navigation on the left - there should be a User Groups option there.
Jun 29, 2009
Philip Kelley says:
Are the group/user names case sensitive? Does the show-to macro see a differenc...Are the group/user names case sensitive? Does the show-to macro see a difference between the following two lines of code?
{show-to:group=GroupName} stuff {show-to}{show-to:group=groupname} stuff {show-to}Mar 26, 2010
JimM says:
I would like to use show-to to show/hide information and a link to a specific pa...I would like to use show-to to show/hide information and a link to a specific page. Ideally this would mean using page leverl permission instead of space level permission as a parameter to show-to. So if there was something just like the space parameter, but instead was a page parameter it would work perfectly for this use case.
Dec 20, 2010
Dhyana Scarano says:
Hi, Could you please fix/update the valid privileges for the "space" parameter....Hi,
Could you please fix/update the valid privileges for the "space" parameter.
At the moment I see this:
If the user has the specified privileges within the spaces listed, the content will be shown. To add a privilege to a specific space, use "SpaceKey:Privilege". Valid privileges are: ${renderedContent}I specifically want to use the macro to hide a section of content from users who don't have permission to add a blog post.
Mar 01, 2011
Exsiss says:
Is this macro still available? I attempted to include it around my builder-comme...Is this macro still available? I attempted to include it around my builder-comments macro so only certain people could see the comments, but I was returned with
Unknown macro: {show-to}.
Mar 02, 2011
Exsiss says:
I figured it out, you need to have the plugin "CustomWare Visibility Plugin" ins...I figured it out, you need to have the plugin "CustomWare Visibility Plugin" installed.
Mar 03, 2011
Samael Bate says:
Theme Builder has hide and show macros of its own: {builder-show} macro {builde...Theme Builder has hide and show macros of its own:
{builder-show} macro
{builder-hide} macro