Access Keys:
Skip to content (Access Key - 0)
Home (Access Key - 1)
All spaces... (Access Key - 3)
Log in (Access Key - 5)
Sign up (Access Key - 6)
Toggle Sidebar

builder-hide macro


{builder-hide} Macro

Description

The builder-hide macro is used to hide content in specific contexts, modes and other filters...

Usage

{builder-hide:mode=view|context=page|label=meetings|metadata=mykey:myvalue}
stuff to hide
{builder-hide}

Parameters

Note:
Some parameters, marked "Theme Only", can only be used within Builder theme panels, ie. you cannot use them within pages, etc.

The "Ver" column shows which version of Theme Builder the parameter became available in.

Property Required Default Notes Theme Panels Only Ver
decorator all decorators Only hide the content when a specific decorator us being used, eg. "printable", etc.  
context all contexts Only hide the content for specific context(s), eg. "page", "global", etc.  
mode all modes Only hide the content for specific modes, eg. "view", "edit", "dashboard", etc.  
space n/a Only hide the content if a specific space (referred to by the Space Key) exists.    
page n/a Only hide the content if a specific page (referred to by the page title) exists.    
title n/a Only hide the content if the current page has a specific title    
label n/a Only hide the content if the the current location (page, news, etc) has the specified label(s), eg. "my:favourite", "meetings", etc.    
metadata n/a Metadata associated with the current location in the frormat: "myKey1:myValue1", etc.   3.0
user All users A comma separated list of usernames. Use @anonymous for anonymous users only.   3.0
group All groups A comma separated list of user groups. Use @anonymous for anonymous users only.   3.0
permission Any permission A comma separated list of permissions:
  • view - user has view permission
  • comment - user can add comments
  • createpage - user can create pages
  • createnews - user can create news
  • edit - user can edit pages or news
  • remove - user can remove (delete) pages, news or comments
  • attach - user can attach files
  • export - user can export pages or the space
  • createspace - user can create spaces
  • spaceadmin - user is a space admin
  • siteadmin - user is a site admin
  3.0
recurse false Should parent pages (if applicable) be checked for title, labels and metadata?
  • false - only check the current page (default)
  • true - also check parent pages, eg. does the current page or any of it's parents have the specified label, etc.
  3.0

While none of the parameters are mandatory, you must specify at least one of them for this macro to work.

You can specify multiple values for any parameter, for example:

{builder-hide:mode=view,edit|context=page,blogpost}
stuff to hide
{builder-hide}

In the example above, "stuff to hide" would only be hiden if the content is being hiden in "view" or "edit" mode and is also either a "page" or "blogpost".

Contexts and Modes

You can determine the context and mode for any page by viewing the page source using your browser. A HTML comment output at the top of all pages hides the context and mode for each page.

View example...

You can specify multiple contexts and modes by separating them with commas as hiden in the usage example earlier. For the macro content to hide, all contexts and modes specified must match.

Examples

Hide content on news items

Hide content on pages and news items

Hide content in edit mode

Specific modes within specific contexts

Hide content based on labels

Hiding content if a space exists

Hide content based on existence of a page

Hide content if the page has a parent

Hide content for specific page titles

Hiding content based on metadata

CSS Customisation

Not applicable for this macro.

Hints and Tips

You can use this macro, and the associated builder-show macro to customise navigation and panel content depending on what the user is looking at.

When using either the mode, context or decorator parameters, remember that they only work if used within a panel of the Builder theme. If you put them inside a normal page, etc., they won't work. Even if you use the move-to macro to move something from a page in to a panel, it still won't work - the mode, context and decorator settings will only work if the macro is actually in the panel notation in the theme cofiguration settings.

If you need to show or hide content based on the privileges within a space, use the [USERGUIDE:show-if] or [USERGUIDE:hide-if] macros that be found in the Visibility Plugin.

Frequently Asked Questions

None at present.

See Also

Toggle Sidebar

See Also

Incoming Links


Outgoing Links


Added by Alain Moran on Oct 09, 2006 23:24, last edited by Guy Fraser on Jul 21, 2008 19:06

Hi,

We are using the following notation in the Builder Theme footer to hide children and attachments on the Home page of a space as well as hide children for pages labeled "category":

{builder-show:context=page,blogpost}{div:class=page-footer}{builder-hide:title=Home}{children}{builder-hide}{menuitem:flat=true}{builder-hide:label=category}{children}{builder-hide}{menuitem:flat=true}{builder-hide:label=hide-attachments}{attachments}{builder-hide}{menuitem:flat=true}{builder-comments}{div}{builder-show}

We can't get this to work. We are using Builder Theme 2.0.9 and Confluence 2.5.1. Any pointers are appreciated!

You had a menuitem closing tag missing and also a menuitem closing tag that had parameters.

For readability, I've split the notation on to several lines with indentation to illustrate:

{builder-show:context=page,blogpost}
 {div:class=page-footer}
  {builder-hide:title=Home}
   {children}
  {builder-hide}
  {menuitem:flat=true}
   {builder-hide:label=category}
    {children}
   {builder-hide}
  {menuitem} <--- missing
  {menuitem:flat=true}
   {builder-hide:label=hide-attachments}
    {attachments}
   {builder-hide}
  {menuitem} <-- closing tag has no params
  {builder-comments}
 {div}
{builder-show}

Thanks for the quick reply, Guy. I made those changes but the children are still shown. I've verified that the page label and title are correct. Is it meaningful that we wrap some items in menuitem but some not? I removed those but it didn't seem to make a difference.

Could something at the global theme level be overriding this perhaps?

I'd like to say:

"Hide this menu option if the group is NOT 'such and such group' AND the title is 'one of these titles'." ... is that possible right now.. I know the Approval Workflow plugin has implemented exclamation points so you can do stuff like this. With builder-hide and builder-show, maybe what I'd want to do could be done with something like this (if implemented):

{builder-hide:!group=groupname|title=title1,title2}whatever{builder-hide}

Thoughts?

I would like to hide a menu item if I'm within a personal space - can I use the builder-hide macro or do I have to define a certain layout for personal spaces?


Adaptavist Theme Builder Powered by Atlassian Confluence