Excerpt |
---|
This macro creates a link to a specific Confluence feature or page relative to the current location in the wiki. |
Each link destination abides by all applicable permissions - should the user not have sufficient permission to use the link, or simply be in a location where the link is not applicable, the body of the macro is returned un-linked (which is then usually hidden by the menuitem macro).
...
To display a text link use the following syntax:
Code Block |
---|
{menulink:destination}Link Text{menulink}
|
To display link inside a menu (see menubar macro), use the following syntax:
Code Block |
---|
{menubar:id=example}
{menuitem}{menulink:destination}Link Text{menulink}{menuitem}
{menubar}
|
...
Expand |
---|
| Click for example |
---|
| Click for example |
---|
|
Code Block |
---|
{menulink:edit}Edit this %page%{menulink}
|
|
...
Destination | Default Location | Notes | Builder Ver | Feature Of |
---|
information | View > This Page > Page Information | Displays information for a page or blog post | 2.0.0 | Confluence |
---|
normalView | View > This Page > Normal view | The normal view of a page. Footnote |
---|
In Theme Builder 2.x this link will return you to the actual page if viewing attachments or information screens for a page. In Theme Builder 3.0 and above, this will display the normal view of whatever you are currently looking at (useful for returning from printable view). |
| 2.0.0 | Confluence |
---|
printableView | View > This Page > Printable view | The print preview of any page. If a sidebar is set to be "collapsed by default" it will not appear in the print preview. Footnote |
---|
In Theme Builder 2.x the printable view simply removes the menu and navigation bars. In Theme Builder 3.0 and above the printable layout (which can be fully customised in Layout Manager will be displayed. |
| 2.0.0 | Confluence |
---|
pageView | View > This Page > View Page | When viewing attachments or page information, this will return you to the normal view of the page. | 3.0 | Confluence |
---|
information | View > This Page > Page Information | Displays page information such as recent changes, author, incoming links, etc. | 2.0.0 | Confluence |
---|
Destination | Default Location | Notes | Builder Ver | Feature Of |
---|
children | View > Show Children | Toggle the display of the builder-children macro | 2.0.0 | Theme Builder |
---|
comments | View > Show Comments | Toggle the display of the builder-comments macro | 2.0.0 | Theme Builder |
---|
toggleVisibility | | Shows or hides a HTML tag (and it's contents) based on it's HTML id (see examples). | 2.0.7 |
---|
...
Destination | Default Location | Notes | Builder Ver | Feature Of |
---|
dashboard | View > Other Pages > Dashbaorddashboard | Site dashboard | 2.0.0 | Confluence |
---|
mail | View > Mail | If a Space has mail in it's mail archive, this will display the mail archive | 2.0.0 | Confluence |
---|
news | View > Other Pages > News | Displays the recent news within a Space | 2.0.0 | Confluence |
---|
recent | View > Other Pages > Recent Updates | Displays the list of recent updates within a Space | 2.0.0 | Confluence |
---|
history | View > Account > History | Displays the history of visited pages, for the current user, in a new window | 2.0.0 | Confluence |
---|
search | | Links to the search screen (defaulting to searching the current space where applicable). | 2.0.0 | Confluence |
---|
index | View > Other Pages > Index | Displays the alphabetical index of content in a Space | 2.0.0 | Confluence |
---|
spaceattachments | View > Other Pages > Attachments | Displays the attachments index within a Space | 2.0.0 | Confluence |
---|
people | View > Other Pages > People Directory | Displays the people directory. | | Confluence |
---|
...
Expand |
---|
|
You can create a link to the dashboard as follows: Code Block |
---|
{menulink:dashbaorddashboard}Go to the dashbaorddashboard{menulink}
|
|
Expand |
---|
| Links in menus |
---|
| Links in menus |
---|
|
When you are adding links in menus, wrap them in the menuitem macro: Code Block |
---|
{menuitem}{menulink:dashbaorddashboard}Go to the dashbaorddashboard{menulink}{menuitem}
|
|
Expand |
---|
| Linking to a Space |
---|
| Linking to a Space |
---|
|
You can link to a space by using a combination of the home location and the space parameter: Code Block |
---|
{menulink:home|space=foo}Go to the home page of the foo space{menulink}
|
That will link to the home page of a Space with a key of "foo". This is really useful because if someone renames the home page this link will still work!
|
Expand |
---|
| Links to features in other spaces |
---|
| Links to features in other spaces |
---|
|
You can link to a feature in another space as follows: Code Block |
---|
{menulink:map|space=wibble}Wibble Site Map{menulink}
|
This would show the site map in the Space with a key of "wibble", regardless of where you are in your site.
|
Expand |
---|
| Tooltips and Access Keys |
---|
| Tooltips and Access Keys |
---|
|
To add tooltips and access keys, use the following notation: Code Block |
---|
{menulink:newcomment|accesskey=c|tooltip=Add comment}Add a comment...{menulink}
|
|
Expand |
---|
| Hiding Inactive Links |
---|
| Hiding Inactive Links |
---|
|
If a menulink is not applicable (eg. user doesn't have privilages or the link does not relate to the current location within your site, etc) then the body text of the link will be output unlinked. For example, if a user does not have comment privileges, then they would see the link shown in the previous example as: Add a comment... Obviously, that's not very useful so you want to hide inactive menu links. To do this, use the menuitem macro which will hide it's body content if there are no links in it: Code Block |
---|
{menuitem:flat=true}{menulink:newcomment}Add a comment...{menulink}{menuitem}
|
If the body of the menuitem macro doesn't contain a link, it will not be shown.
|
Expand |
---|
| unmigrated-wiki-markup |
You can open the link destination in a specific frame or window using the ??target ?? parameter:
{ Code Block |
---|
}
{menulink:map|target=_blank}Open site map in new window{menulink}
{code}
Which results in: {menulink:map|target=_blank}Open site map in new window{menulink}
| |
Expand |
---|
|
Expand |
---|
Toggle the Visibility of an on-screen element | | Toggle the Visibility of an on-screen element |
---|
| unmigrated-wiki-markup |
You can toggle the visibility of any HTML tag with a unique id using the code below:
{ Code Block |
---|
}
{div:id=visdemo}*This is a div tag with id of "visdemo" that you can show or hide using the link below.*{div}
{menulink:toggleVisibility|toggle=visdemo}Toggle the text above{menulink}
{code}
| As you can see, the div tag has been given a HTML id - the raw HTML looks like this: Code Block |
---|
|
{code:html}
<div id="visdemo"> ... <div>
{code}
|
And the "target" parameter in the menulink macro states what id will be toggled. If you want the tag to initially be hidden, use the "display:none" CSS style: Code Block |
---|
toggled.
The result:
{div:id=visdemo=visdemo1|style=display:none;}*This is a div tag with id of "visdemovisdemo1" that you can show or hide using the link below.*{div}
{menulink:toggleVisibility|toggle=visdemovisdemo1}ToggleShow/hide the text above{menulink}
If you want the tag to initially be hidden |
The div tag will now be output with a style attribute like this: Code Block |
---|
|
<div id="visdemo1" style=, use the "display:none;"> CSS style:
{code}
{div:id=visdemo1|style=display:none;}*This is a div tag with id of "visdemo1" that you can show or hide using the link below.*{div}
{menulink:toggleVisibility|toggle=visdemo1}Show/hide the text above{menulink}
{code}
The div tag will now be output with a style attribute like this:
{code:html}
<div id="visdemo1" style="display:none;"> ... <div>
{code}
Note that we've changed the id from "visdemo" to "visdemo1" - that's because a HTML id must be unique to the entire web page. If there are two or more occurrences of the same id, the results can be very unpredictable so make sure to use unique id's.
The result (it starts hidden so click the link to see it):
{div:id=visdemo1|style=display:none;}*This is a div tag with id of "visdemo1" that you can show or hide using the link below.*{div}
{menulink:toggleVisibility|toggle=visdemo1}Show/hide the text above{menulink}
... <div>
|
Note that we've changed the id from "visdemo" to "visdemo1" - that's because a HTML id must be unique to the entire web page. If there are two or more occurrences of the same id, the results can be very unpredictable so make sure to use unique id's. |
Expand |
---|
| Linking to other sites |
---|
| Linking to other sites |
---|
|
To add tooltips and access keys, use the following notation: Code Block |
---|
{menulink:custom|link=http://www.domain.com/path/resource.file}Other{menulink}
|
|
Expand |
---|
| How do I show Web UI links? |
---|
| How do I show Web UI links? |
---|
|
Web UI links are a feature of Confluence plugins that allow them to add additional navigation to the default themes. However, because Theme Builder displays navigation in a significantly different format, we can't display those links by default otherwise we'd end up with duplicate and confusing navigation in the default menus. Web UI link support was added in Theme Builder 2.0.8 and above. Before adding Web UI links as shown below, please check the table above the Examples section on this page which lists a number of aliases for popular third party plugins. To add Web UI links to Theme Builder meuns, use the following syntax: Code Block |
---|
{menulink:webui|location=XXXX|key=YYYY}webui link{menulink}
|
For example, here's the markup used for the podcasting plugin: Podcast Page Tab Code Block |
---|
{menulink:webui|location=system.page|key=podcast-episode-page-webui}Edit Podcast{menulink} |
Podcast News Item Tab Code Block |
---|
{menulink:webui|location=system.news|key=podcast-episode-blogpost-webui}Edit Podcast{menulink} |
Podcast Channels Space Tab Code Block |
---|
{menulink:webui|location=system.space|key=space-podcast-channel-webui}Podcast Channels{menulink} |
Note: There are aliases for these links in the table further up the page, the links shown above are just to illustrate how to manually construct those links. If you don't specify any link text (eg. "Edit Podcast") then the default text supplied by the plugins' Web UI link will be used. Important Many third party plugins don't do strict checking of the mode and context to determine whether a Web UI link should be displayed. Because Theme Builder can display Web UI links in any area of Confluence, you might need to use the builder-show macro or builder-hide macro to show/hide Web UI links that start appearing in too many places. If you need a technical explanation as to why this is the case, or any help with working with Web UI links in third party plugins, please contact our support desk. When using the menulink inside a menu, it needs to be wrapped in the menuitem macro, eg: Code Block |
---|
{menuitem}{menulink:webui|location=system.space|key=space-podcast-channel-webui}Podcast Channels{menulink}{menuitem} |
|
...
You can create keyboard shortcuts by adding empty menulinks to a panel in builder (eg. title or footnotes panel, etc), for example:
Code Block |
---|
{menulink:edit|tooltip=Edit this content|accesskey=e}{menulink}
|
...