The show-to-authenticated and show-to-anonymous user macros provide a quick way to show content to only authenticated or anonymous users. (OBSOLETE)
| As of version 1.6.0, this functionality is incorporated into the show-to and hide-from macros of the Visibility Plugin. VISIB-22 |
| This macro is for display purposes only. Any user can still see the content in the Page Info, Page Edit tabs or any Version History views. |
Usage
{show-to-authenticated}Welcome authenticated user{show-to-authenticated}
{show-to-anonymous}Click [here] to login.{show-to-anonymous}
Installation
| using confluence 2.3's options: has body, unrendered, and macro generates wiki markup |
User Macro: show-to-anonymous
#set($username=$action.getRemoteUser().getName()) #if($username && $username.length()>0) ## authenticated, do nothing #else ## not authenticated, rendering body: $body #end
User Macro: show-to-authenticated
#set($username=$action.getRemoteUser().getName()) #if($username && $username.length()>0) ## authenticated, rendering body: $body #else ## not authenticated, do nothing #end
The Visibility Plugin's show-to macro and hide-from macro can be used for a similar effect, but depend on having a group called 'confluence-users' that has everyone in its membership, and this does not currently work on LDAP.

Comments (3)
Sep 26, 2007
Brian M. Thomas says:
Links ostensibly pointing to pages for the {show-to} and {hide-from} macros in t...Links ostensibly pointing to pages for the {show-to} and {hide-from} macros in the above text are incorrect, and are consequently Add Page links.
Sep 26, 2007
Mei Yan Chan says:
Hi Brian, The above {show-to} and {hide-from} macros are link to http://conflue...Hi Brian,
The above {show-to} and {hide-from} macros are link to http://confluence.atlassian.com/display/CONFEXT/show-to+macro and http://confluence.atlassian.com/display/CONFEXT/hide-from+macro accordingly which subsequently links to the Visibility Plugin. I am not particularly sure when you say they are Add Page links.
Regards,
Mei
Sep 27, 2007
James Mortimer says:
because at the time he wrote the comment, they were not linked to anything. I ...