[All Adaptavist Apps]
The builder-hide macro is
Excerpt |
---|
used to hide content in specific contexts, modes and other filters |
Code Block |
---|
{builder-hide:mode=view|context=page|label=meetings|metadata=mykey:myvalue}
stuff to hide
{builder-hide}
|
...
Property | Required | Default | Notes | Theme Panels Only | Ver | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
decorator | all decorators | n/a | Only hide the content when a specific decorator us being used, eg. "printable", etc. |
| ||||||||
contextaction | all contexts | n/a | Only hide the content for specific contextaction(s), eg. "page", "global", etcviewpage". NB: The ".action" part of the action name should not be included. |
| 3.0 | |||||||
modecontext | all modes | n/a | Only hide the content for specific modescontext(s), eg. "viewpage", "editglobal", "dashboard", etc. |
| ||||||||
spacemode | n/a | all modes | Only hide the content if a specific space (referred to by the Space Key) exists.for specific modes, eg. "view", "edit", etc. |
|
| |||||||
pagespace | n/a | Only hide the content if a specific page space (referred to by the page titleSpace Key) exists. |
|
| ||||||||
titlespacekey | current space | The space against which permission checks will be made. Default is current space. |
|
| ||||||||
pagetitle | current page | the page against which permission checks will be made. Default is current page | n/a | Only hide the content if the current page has a specific title |
|
| ||||||
labelpage | n/a | Only hide the content if the the current location (page, news, etc) has the specified label(s), eg. "my:favourite", "meetings", etca specific page (referred to by the page title) exists. @parent can be used to hide data if the page is not at the root level, @child can be used to hide data if the page has children. |
|
| ||||||||
metadatapluginkey | n/a | Metadata associated with the current location in the frormat: "myKey1:myValue1", etc. |
| The key of a plugin which must be enabled for the content to be shown |
|
| ||||||
title | 3.0 | action | n/a | A comma separated list of actions (eg: viewpage/login/logout) where the content should be hidden |
| 3.0 | ||||||
spacekey | current space | The space against which checks will be made |
| 3.0 | ||||||||
pagetitle | current page | The page against which checks will be made |
| 3.0 | ||||||||
Only hide the content if the current page has a specific title |
|
| ||||||||||
label | pluginkey | n/a | The key of a plugin which must be enabled for the content to be hidden |
| Only hide the content if the the current location (page, news, etc) has the specified label(s), eg. "my:favourite", "meetings", etc. |
| 3.0 | |||||
spacelabel | n/a | A comma separated list of labels applied to the space for which the content should be hidden |
| 3.0 | Only hide the content if the the current space has the specified label(s), eg. "meetings", etc. |
|
| |||||
teamlabelmetadata | n/a | comma separated list of metadata name:value pairs where the content should be hidden (recursable) |
| 3.0 | Only hide the content if the the current space has the specified team label(s), eg. "sales,marketing", etc. |
|
| |||||
metadatateam | n/a | Metadata associated with the current location in the format: "myKey1:myValue1, myKey1:myValue1, etc". when checking for a key with a specific value. To check for the existance of metadata with any value supply a commas separated list of key names, eg: "mykey1, mykey2, mykey3" or mix & match "mykey1, mykey2:myvalue2" |
|
| ||||||||
user | n/a | Matches against the current user (NB: modified by withuser) - A comma separated list of usernames. Use |
| 3.0 | ||||||||
withuser | @current | username that user/group/permission checks should be run against. This includes @anonymous, @creator, @author, @current |
| 3.2.2 | ||||||||
group | n/a | A comma separated list of user groups that the current user (NB: modified by withuser) should be a member of |
| 3.0 | ||||||||
permission | n/a | A comma separated list of permissions:
|
| 3.0 | ||||||||
recurse | false | Should parent pages (if applicable) be checked for title, labels and metadata?
| A comma separated list of team-labels applied to the space for which the content should be hidden |
| 3.0 | user | All users | A comma separated list of usernames. Use @anonymous for anonymous users only
|
| 3.0 | ||
asuserrestriction | @current | n/a | hide content if the page has a restriction in place (none/view/edit/vieworedit/viewandedit - recursableUsername that user/group/permission checks should be run against (inc @anonymous, @creator, @author, @current) |
| 3.0 | |||||||
permissionuseragent | Any permission | n/a | A comma separated list of permissions:
|
| 3.0 | |||||||
recurse | false | Should parent pages (if applicable) be checked for title, labels and metadata?
|
| 3.0 | ||||||||
restriction | All groups | hide content if the page has a restriction in place (none/view/edit/vieworedit/viewandedit - recursable). |
| 3.0 | ||||||||
useragent | n/a | A comma separated list of tokens to match against the user agent string of the requesting browser. | 3.2.1 | |||||||||
tokens to match against the user agent string of the requesting browser. | 3.2.1 | |||||||||||
attachment | n/a | comma separated list of filenames, one of which must be attached to the current page for the content to be hidden. | 3.2.2 | |||||||||
olderthan | n/a | Content is hidden if the current page was modified before the given time period from the current date. The date is shown in this format: olderthan=1y6m1d1h (year/month/day/hour) |
| 3.3.0 | ||||||||
newerthan | n/a | Content is hidden if the current page was modified after the given time period from the current date. The date is shown in this format: newerthan=1y6m1d1h (year/month/day/hour) |
| 3.3.0 | ||||||||
flag |
| Content is hidden if one or more of the specified flags are set. See Working with Flags for more details. | 3.3.6 | |||||||||
notflag |
| Content is hidde if none of the specified flags are set. See Working with Flags for more details. | 3.3.6 | attachment | n/a | Hides content if page or news item contains specified attachments | 3.2.2 |
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:
Code Block |
---|
{builder-hide:mode=view,edit|context=page,blogpost}
stuff to hide
{builder-hide}
|
...
Expand | ||||
---|---|---|---|---|
| ||||
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 hiden in the usage example earlier. For the macro content to hide, all contexts and modes specified must match.
...
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
| ||||||
Expand | ||||||
Hiding content based on metadata | Hiding content based on metadata |
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
Wiki Markup |
|
Not applicable for this macro.
...
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 Pluginpanel, 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 with more complex conditions, there are extra aliases builder-hide2 -> builder-hide9 which may be used for nesting.
Multiple conditions are combined in AND mode, so all of the applied conditions need to be true for the content to be hidden.
To apply conditions in an OR mode you should use several copies of the hide macro, each with separate conditions.
...