The builder-show macro is
used to show content in specific contexts, modes and other filters |
{builder-show:mode=view|context=page|label=meetings|metadata=mykey:myvalue} stuff to show {builder-show} |
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 show the content when a specific decorator us being used, eg. "printable", etc. |
|
||
action |
all actions |
Only show the content for specific action(s), eg. "viewpage". NB: The ".action" part of the action name should not be included. |
|
3.0 |
|
context |
all contexts |
Only show the content for specific context(s), eg. "page", "global", etc. |
|
||
mode |
all modes |
Only show the content for specific modes, eg. "view", "edit", etc. |
|
||
space |
n/a |
Only show the content if a specific space (referred to by the Space Key) exists. |
|
|
|
page |
n/a |
Only show the content if a specific page (referred to by the page title) exists. |
|
|
|
title |
n/a |
Only show the content if the current page has a specific title |
|
|
|
label |
n/a |
Only show the content if the the current location (page, news, etc) has the specified label(s), eg. "my:favourite", "meetings", etc. |
|
|
|
spaceLabels |
n/a |
Only show the content if the the current space has the specified label(s), eg. "meetings", etc. |
|
3.0 |
|
teamLabels |
n/a |
Only show the content if the the current space has the specified team label(s), eg. "sales,marketing", etc. |
|
3.0 |
|
metadata |
n/a |
Metadata associated with the current location in the format: "myKey1:myValue1", etc. |
|
3.0 |
|
user |
All users |
A comma separated list of usernames. Use |
|
3.0 |
|
group |
All groups |
A comma separated list of user groups. Use |
|
3.0 |
|
permission |
Any permission |
A comma separated list of permissions:
|
|
3.0 |
|
recurse |
false |
Should parent pages (if applicable) be checked for title, labels and metadata?
|
|
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-show:mode=view,edit|context=page,blogpost} stuff to show {builder-show} |
In the example above, "stuff to show" would only be shown if the content is being shown in "view" or "edit" mode and is also either a "page" or "blogpost".
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 shows the context and mode for each page.
If you view the HTML source of this web page you'll see the following:
|
You can specify multiple contexts and modes by separating them with commas as shown in the usage example earlier. For the macro content to show, all contexts and modes specified must match.
|
|
|
|
|
|
|
|
|
|
Not applicable for this macro.
You can use this macro, and the associated builder-hide 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 show-if or hide-if macros that be found in the Visibility Plugin.
None at present.