[All Adaptavist Apps]

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
h1. \{menulink} Macro

h2. Description

{excerpt}This macro creates a link to a specific Confluence feature or page relative to the current location in the wiki.{excerpt}

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]).

h2. Requirements

This macro requires [Theme Builder 2.0|Builder:Builder] or above.

h2. Usage

{code}
{menulink:linktype|tootlip=tooltip text|accesskey=key}Link Text{menulink}
{code}

h3. Parameters

The *Ver* column denotes the minimum version of Theme Builder that is required. 

||Property||Required||Default||Notes||Ver||
||_default_|(/)| |The destination to link to (see list below)|2.0|
||space|(x)|_current space_|Optionally set the space to which the link relates.| |
||page|(x)|_current page_|Optionally set the page to which the link relates, eg. when using the "newpage" destination you can define the parent page with this parameter.{footnote}Use Builder 2.0.7 or above if you are using Confluence 2.5 or above to get the "page" parameter to work properly.{footnote}| |
||parent|(x)|_space homepage_|When using the "exportMail" destination, this defines the page that will be the parent of the new page containing the exported mail message.| |
||link|(x)| |When using the "custom" destination (see examples) this is the URL to link to.| |
||toggle|(x)| |When using the "toggleVisibility" destination (see examples) this is the HTML id of the tag to show/hide.|3.0|
||tooltip|(x)| |The tooltip to display when the mouse hovers over the link (max: 77 chars for cross-platform compatibility){footnote}When using the link in a menu, tooltips will only be shown if enabled in theme configuration. In all other formats, the tooltip will always be shown when the mouse hovers over the link.{footnote}| |
||accesskey|(x)| |An optional shortcut key for the link which can be any alphanumeric character{footnote}When using links inside menus, you can also prefix a letter in the link text with an "_" to define the access key - this letter will then be underlined when displayed in the menu. Access keys only work when the associated item is visible on screen.{footnote}| |
||target|(x)|_current browser window_|An optional target window or frame in which to load the link destination.|2.0.9|
||class|(x)| |Optional HTML classes to associated with the hyperlink.| |
||hideanon|(x)|false|Whether to hide the link from anonymous users:
* false - don't hide from anonymous users (default)
* true - always hide from anonymous users, even if they have privileges to use the link|3.0|
||rel|(x)|_automatic_|The "rel" attribute to assign to the link. Many links get an automatic rel attribute (eg. rel="index" for the index link) and also "nofollow" rels to prevent search engines following links that alter content, etc.|3.0|
||layout|(x)| |When using the use-layout location, defines the layout ID to use.|3.0|
||latch|(x)|false|When using the use-layout location, determines whether the layout should be used temporarily for the resulting page view or latched for all subsequent page views.
* false - don't latch the layout (default)
* true - latch the layout so it's used for subsequent page views|3.0|
||item|(x)| | |3.0|

{display-footnotes}

h3. Caption Fields

Some link locations provide fields for captions which get automatically replaced when the links are displayed based on the state of the link location.

For example, the {{%page%}} field will be replaced with either "page" or "news" depending on whether you're looking at a page or a blog post.

{expand:Click for example}{quote}
{code}
{menulink:edit}Edit this %page%{menulink}
{code}
{quote}{expand}

||Field||Link Destinations||Notes|
||%page%|information, edit, remove, favourite, favouritespace, watch, watchspace, watchpage|Displays either "page", "news" or "space" as applicable to the content you are currently viewing.|
||%count%|spaceattachments, children, comments, pageattachments|Displays the number of attachments, children or comments as applicable to the link location.|
||%user%|profile, userspace|Displays the users full name.|
||%space%, %Space%|activity|Displays "space" or "site" - the %Space% field capitalises the first letter, eg. "Space" or "Site".|
||%add%|favourite, favouritespace, watch, watchspace, watchpage|Displays "Add" or "Remove" depending on whether the content is in your favourites or watched.|
||%watching%, %watch%|watch, watchspace, watchpage|Displays "Watching" or "Watch" (%watching%), "Watch" or "Unwatch" (%watch) depending on whether you are watching the content.|

h3. Link Destinations

The following link destinations can be used in the menulink macro and also the [compound-menuitem macro].

The *Ver* column denotes which version of Theme Builder is required. 

{expand:Account management}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||login|View > Account > Login|If the user is logged out, this will take them to the login screen|2.0.0|Confluence|
||logout|View > Account > Logout|If the user is logged in, this will take them to the logout screen|2.0.0|Confluence|
||profile|View > Account > Preferences: <name>|If the user is logged in, this will take them to their personal profile screen|2.0.0|Confluence|
||userspace|View > Account > Personal Space|Displays the users' personal space if they have one, otherwise it displays their personal profile|2.0.0|Confluence|
||signup|View > Account > Sign-up|Displays the user sign-up screen (if public sign-up is enabled in General Configuration)|2.0.2|Confluence|
{quote}{expand}

{expand:Community Features}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||inviteothers| | |3.0|Invite Plugin|
||invitelist| | |3.0|Invite Plugin|
||invite|View > Invite Friends| |3.0|Invite Plugin|
||customusermanagement|Edit > Administration > User Management...|Displays screen for editing the user group associated with current space.|2.0.8|[Custom Space User Management|http://confluence.atlassian.com/display/CONFEXT/Custom+Space+User+Management+Plugin]|
||space-socialbookmarks|View > Other Pages > Bookmarks|Displays a list of bookmarks for the current space.|3.0|Social Bookmarking Plugin|
||review|Edit > New > Review...|Adds a new review for the current page.|2.0.8|Mark for Review Plugin|
{quote}{expand}

{expand:Web Feeds}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||podcastpage|Edit > Podcast Settings...|Configures Podcast settings for a page.|2.0.8|[Podcast Plugin|http://confluence.atlassian.com/display/CONFEXT/Podcasting+Plugin]|
||podcastnews|Edit > Podcast Settings...|Configures Podcast settings for a blog post (news).|2.0.8|[Podcast Plugin|http://confluence.atlassian.com/display/CONFEXT/Podcasting+Plugin]|
||podcastchannels|View > Other Pages > Podcasts|Displays Podcast channels screen for a space (which also allows channels to be edited).|2.0.8|[Podcast Plugin|http://confluence.atlassian.com/display/CONFEXT/Podcasting+Plugin]|
||RSS|View > Other Pages > RSS Feed Builder|Displays the RSS Feed Builder|2.0.0|Confluence|
{quote}{expand}

{expand:Folksonomy (Labels/Tags)}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||labels|View > Other Pages > Labels|Displays the labels within a space or global labels if used outside a Space|2.0.0|Confluence|

label
globalLabel
{quote}{expand}

{expand:Interest Management}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||favourite|View > This Page > Add/remove favourite|Adds or removes the current page/news/space to or from personal favourites. See also: [builder-favicon macro]|2.0.0|Confluence|
||watch|View > This Page > Watch this page/news/space|Toggles email notifications when current page/news/space is changed|2.0.0|Confluence|
||pagewatcher|View > This Page > Watchers|Displays a list of people watching the current page, editable by admins.|3.0|[Community Bubbles|ADAPTAVIST:Bubbles]|
||newswatcher|View > This Page > Watchers|Displays a list of people watching the current blogpost, editable by admins.|3.0|[Community Bubbles|ADAPTAVIST:Bubbles]|
||pagefavourites|View > This Page > Favourites|Displays a list of people who have marked the page as their favourite, editable by admins.|3.0|[Community Bubbles|ADAPTAVIST:Bubbles]|
||newsfavourites|View > This Page > Favourites|Displays a list of people who have marked the blogpost as their favourite.|3.0|[Community Bubbles|ADAPTAVIST:Bubbles]|
||favouritespace| |Adds or removes the current space from the logged in users' favourites.|3.0|Confluence|
||watchspace| |Toggles email notifications for the space for the logged in user.|3.0|Confluence|
||watchpage| |Toggles email notifications for the current page or blogpost for the logged in user. See also: [builder-watchicon macro]| |Confluence|
||activity|View > Other Pages > Usage Statistics|Links to the activity graphs for the current space or entire site (depending on current location in wiki).| |Activity Plugin|
{quote}{expand}

{expand:Content Creation}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||newcomment|Edit > New > Comment...|Creates a new comment on a page or news item (blog post) within a Space|2.0.0|Confluence|
||newnews|Edit > New > News...|Creates a new news item (blog post) within a Space|2.0.0|Confluence|
||newpage|Edit > New > Page...|Creates a new page within a Space|2.0.0|Confluence|
||newspace|Edit > New > Space...|Creates a new Space|2.0.0|Confluence|
||addbookmark|Edit > New > Bookmark...|Links to the "Add Bookmark" screen.|3.0|Social Bookmarking Plugin|
||editgridaddbook|Edit > New > Spreadsheet...|Adds a new editable spreadsheet to the page.|2.0.8|[Edit Grid|http://confluence.atlassian.com/display/CONFEXT/EditGrid+Plugin+-+Edit+Spreadsheet+in+Confluence]|
{quote}{expand}

{expand:Content Management}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||copy|Edit > Copy this Page...|Creates an editable copy of a page (and optionally copies over it's children)|2.0.0|Confluence|
||edit|Edit > Edit this Page/News...|Edits the current page or news item|2.0.0|Confluence|
||remove|Edit > Remove this Page/News...|Deletes (after confirmation) the current page or news item|2.0.0|Confluence|
||editinword|Edit > Edit in Word|Edits the current page in MS Word.|3.0|WordDAV Plugin|
||addgliffydiagram|Edit > New > Diagram...|Adds a new Gliffy diagram to a wiki page.|2.0.8|[Gliffy Plugin|http://confluence.atlassian.com/display/CONFEXT/Gliffy+Plugin+for+Confluence+-+Diagram+and+draw+in+Confluence]|
||pageattachments|Edit > Attachments|Displays the attachments for a page or news item|2.0.0|Confluence|
{quote}{expand}

{expand:Content Exporting}{quote}
These options allow you to export content in different formats.

||Destination||Default Location||Notes||Builder Ver||Feature Of||
||emailpage|View > This Page > Email to a friend...|Allows the user to email the page to a friend.|2.0.7|Mail Page Plugin|
||exportMail|View > This Page > Export to Wiki Page|When viewing a mail message in the space mail archive, this will export that message (including attachments) to a new, editable wiki page|2.0.7|Theme Builder|
||exportPDF|View > This Page > Export to Adobe Acrobat (PDF)|Exports the page (and in some versions of Confluence, a blog post) to a PDF file|2.0.0|Confluence|
||exportWord|View > This Page > Export to Microsoft Word|Exports the page (and in some versions of Confluence, a blog post) to a Word document|2.0.0|Confluence|
{quote}{expand}

{expand:Display Mode}{quote}
||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).{footnote}|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.{footnote}|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|
{display-footnotes}
{quote}{expand}

{expand:Visibility Settings}{quote}
||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|

toggleSidebar
{quote}{expand}

{expand:General Navigation}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||dashboard|View > Other Pages > Dashbaord|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|
{quote}{expand}

{expand:Hierarchical Navigation}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||home|View > Other Pages > Home Page|If used within a Space, this takes the user to the space home page. If used anywhere else, the site home page is shown. The site home page is either the user's homepage (if set in their profile), the site homepage (if set in General Configuration) or the Dashboard (default)|2.0.0|Confluence|
||next| |Links to the next sibling page.|3.0|Theme Builder|
||prev| |Links to the previous sibling page.|3.0|Theme Builder|
||parent| |Links to the parent of the current page.|3.0|Theme Builder|
||first| |Links to the first sibling page.|3.0|Theme Builder|
||last| |Links to the last sibling page.|3.0|Theme Builder|
||firstchild| |Links to the first child page.|3.0|Theme Builder|
||lastchild| |Links to the last child page.|3.0|Theme Builder|
||map|View > Other Pages > Site Map|Displays the tree view of hierarchical pages (with current page selected if applicable) within a Space.|2.0.0|Confluence|
{quote}{expand}

{expand:Custom Links}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||custom| |Allows you to specify a custom URL. This is often useful if you want an external web page to launch in a new window because you can combine it with the "target" parameter.| |Theme Builder|
||webui| |Displays a "Web UI" link (some plugins use these to add additional navigation, etc). See Examples for more details. The next section (third-party) lists some inbuilt webui aliases for popular plugins.|2.0.8|Confluence|
||wikipage| |Links to a wiki page, the page being defined using the {{page}} parameter (and optionally the {{space}} parameter if the page is in a different space.|3.0|Confluence|
{quote}{expand}

{expand:Theme Configuration}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||configuretheme|Edit > Administration > Configure Theme|Displays the theme configuration page (Builder 2.x) or [Layout Chooser] (Builder 3.0 and above).|2.0.0|Theme Builder|
||colourscheme|Edit > Administration > Colour Scheme|Displays the space or global (as applicable to current location) colour scheme editor.|3.0|Confluence|
||chooselayout|Edit > Administration > Choose Layout|Displays the [Layout Chooser].|3.0|Theme Builder|
||managelayouts|Edit > Administration > Manage Layouts|Displays the [Layout Manager].|3.0|Theme Builder|
||themeadmin|Edit > Administration > Theme Administration|Displays the [Theme Administration] screen.|3.0|Theme Builder|
||use-layout| |Allows selection of a different layout. See examples and also [use-layout macro].|3.0|Theme Builder|
{quote}{expand}

{expand:Administration}{quote}
||Destination||Default Location||Notes||Builder Ver||Feature Of||
||advanced|Edit > Administration > Advanced|Displays the "advanced" screen|2.0.0|Confluence|
||siteadmin|Edit > Administration > Site Administration|Displays the Administration Console|2.0.0|Confluence|
||spaceadmin|Edit > Administration > Space Administration|Displays teh Space administration screen|2.0.0|Confluence|
||admingliffy|Edit > Admiinstration > Gliffy...|Links to the Gliffy administration screen.|2.0.8|[Gliffy|http://confluence.atlassian.com/display/CONFEXT/Gliffy+Plugin+for+Confluence+-+Diagram+and+draw+in+Confluence]|
||reviewreport|Edit > Administration > Reviews|Displays review report for the space.|2.0.8|Mark for Review Plugin|
||reviewspaceconfig|Edit > Administration > Review - Space Config|Space-level configuration for Reviews.|2.0.8|Mark for Review Plugin|
||reviewglobalconfig|Edit > Administration > Review - Admin Config|Global configuration for Reviews.|2.0.8|Mark for Review Plugin|
||inviteothersadmin|Edit > Administration > Invite Others| |3.0|Invite Plugin|
||invitelistadmin|Edit > Administration > Invite List| |3.0|Invite Plugin|
||globaltemplates|Edit > Administration > Global Templates|Displays the global templates|2.0.0|Confluence|
||spacetemplates|Edit > Administration > Space Templates|Displays the templates within a Space|2.0.0|Confluence|
{quote}{expand}

h2. Examples

{expand:Basic use}
{quote}
You can create a link to the dashboard as follows:

{code}
{menulink:dashbaord}Go to the dashbaord{menulink}
{code}
{quote}
{expand}

{expand:Links in menus}
{quote}
When you are adding links in menus, wrap them in the [menuitem macro]:

{code}
{menuitem}{menulink:dashbaord}Go to the dashbaord{menulink}{menuitem}
{code}
{quote}
{expand}

{expand:Linking to a Space}
{quote}
You can link to a space by using a combination of the {{home}} location and the {{space}} parameter:

{code}
{menulink:home|space=foo}Go to the home page of the foo space{menulink}
{code}

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!
{quote}
{expand}

{expand:Links to features in other spaces}
{quote}
You can link to a feature in another space as follows:

{code}
{menulink:map|space=wibble}Wibble Site Map{menulink}
{code}

This would show the site map in the Space with a key of "wibble", regardless of where you are in your site.
{quote}
{expand}

{expand:Tooltips and Access Keys}
{quote}
To add tooltips and access keys, use the following notation:

{code}
{menulink:newcomment|accesskey=c|tooltip=Add comment}Add a comment...{menulink}
{code}
{quote}
{expand}

{expand:Hiding Inactive Links}
{quote}
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}
{menuitem:flat=true}{menulink:newcomment}Add a comment...{menulink}{menuitem}
{code}

If the body of the [menuitem macro] doesn't contain a link, it will not be shown.
{quote}
{expand}

{expand:Link Target}
{quote}
You can open the link destination in a specific frame or window using the ??target?? parameter:

{code}
{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}
{quote}
{expand}

{expand:Toggle the Visibility of an on-screen element}
{quote}
(!) There is a bug in Builder 2.0.1 - please don't use this link destination until further notice as it doesn't work.

You can toggle the visibility of any HTML tag with a unique id using the code below:

{code}
{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|target=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:html}
<div id="visdemo"> ... <div>
{code}

And the "target" parameter in the menulink macro states what id will be toggled.

The result:

{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|target=visdemo}Toggle the text above{menulink}

If you want the tag to initially be hidden, 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|target=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|target=visdemo1}Show/hide the text above{menulink}
{quote}
{expand}

{expand:Linking to other sites}
{quote}
To add tooltips and access keys, use the following notation:

{code}
{menulink:custom|link=http://www.domain.com/path/resource.file}Other{menulink}
{code}
{quote}
{expand}

{expand:How do I show Web UI links?}
{quote}
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.

(i) 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}
{menulink:webui|location=XXXX|key=YYYY}webui link{menulink}
{code}

For example, here's the markup used for the podcasting plugin:

*Podcast Page Tab*
{code}{menulink:webui|location=system.page|key=podcast-episode-page-webui}Edit Podcast{menulink}{code}

*Podcast News Item Tab*
{code}{menulink:webui|location=system.news|key=podcast-episode-blogpost-webui}Edit Podcast{menulink}{code}

*Podcast Channels Space Tab*
{code}{menulink:webui|location=system.space|key=space-podcast-channel-webui}Podcast Channels{menulink}{code}

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}{menuitem}{menulink:webui|location=system.space|key=space-podcast-channel-webui}Podcast Channels{menulink}{menuitem}{code}
{quote}
{expand}

h2. Hints and Tips

You can create keyboard shortcuts by adding empty menulinks to a panel in builder (eg. title or footnotes panel, etc), for example:

{code}
{menulink:edit|tooltip=Edit this content|accesskey=e}{menulink}
{code}

This would add the keyboard shortcut "Alt+E" to all screens that can be edited (eg. blogposts, pages, etc). The shortcut would only be available if the current user has sufficient privileges to edit the page, etc.