The {link-to} macro allows you to link to almost every feature in Confluence...
Normal Link Notation makes it easy to link to common content such as pages and news. However, there are cases where you might want to link to global locations (such as The Dashboard), space locations (such as the Site Map) or even page locations (such as Page Information) - this macro allows you to link to all these additional places!
In the examples within this tutorial, we'll also make regular use of the show-to macro and hide-from macro to ensure that links are only shown when applicable.
Parameters:
The macro hyperlinks whatever it contains as shown below:
{link-to:location}click here{link-to}
The following parameters can be used in multiple scenarios:
| Parameter | Required | Default | Notes |
|---|---|---|---|
| default | The location to link to - see "Locations" below. | ||
| space | Current Space | The space in which the location resides (if applicable). | |
| page | Current Page | The page in which the location resides (if applicable). | |
| popup | false | Normally, clicking the link will open the location in the current window. If you set this parameter to true the location will be opened in a new browser window. | |
| target | When opening the link in a new window, this parameter specifies the target name for that window. Suggested name: _blank | ||
| title | Defines the tooltip text that will appear when the mouse is hovered over the link. |
Locations
The various locations that can be linked to are split in to four categories as follows...
Global Locations
| Location | Description |
|---|---|
| admin | The Administration Console - the user must have administration privileges. |
| dashboard | The Dashboard. |
| global templates | The global templates page. |
| homepage | The user's homepage, if set in their profile, otherwise the Site Homepage. |
| login | The login screen. |
| logout | The logout screen (logs the user out in the process if applicable). |
| notation guide | The Wiki Markup Editor notation guide. |
| rss feed builder | The RSS Feed Builder. |
| user profile | The profile for the logged in user. |
| user history | The list of recently viewed pages for the current user (including anonymous users). |
Space Locations
Links contained inside a space (eg. on pages, comments, etc) will default to the current space. To use an alternate space, or a specific space when using these locations from outside a space, please specify the space parameter.
| Location | Description |
|---|---|
| add news | Adds a news item. User must have "add news" privilege. |
| browse space | Goes to the 'Browse Space' section. |
| Displays the mail archive, if configured. | |
| news | Displays recent news items, if there are any. |
| pages alphabetical | Displays the alphabetically sorted page index. |
| pages tree | Displays the hierarchical site map. |
| pages updated | Displays a list of recently updated pages. |
| space attachments | Displays a list of all attachments in the space, with ability to filter by extension. |
| space templates | Displays a list of templates defined within the space. |
| popular labels | Displays the "popular labels" page within a space. |
| all labels | Displays the "all labels" page within a space. |
RSS Feeds
RSS feeds are also space specific and allow external applications to monitor a space for updates...
| Location | Description |
|---|---|
| rss comments | New comments are added to this feed. |
| rss news | News items for the space are added to the feed. |
| rss new pages | Any new pages in the space are added to the feed. |
| rss updated pages | Any updated pages in the space are added to the feed. |
Page Locations
| Location | Description |
|---|---|
| @parent | The parent of the current page. |
| @self | The current page. |
| add comment | Opens the 'add comment' section of the page. |
| page comments | Jumps to the page comments. |
| page attachments | The attachments tab for the page. |
| page children | Jumps to the page children list. |
| page edit | The edit tab for the page. |
| page history | The history details for the page. |
| page info | The info tab for the page. |
| page source | The source code for the page. |
| pdf export | Export the page to PDF. |
| The print view for the page. |
Examples - Global Locations
Examples - Space Locations
More examples will be added as time permits...
Frequently Asked Questions
| Q | I can't use the spaces location - is there another way to show the user what spaces they can access? |
|---|---|
| A | Yes. Simply link to The Dashboard using the dashboard location. The dashboard contains a list of all spaces that the user can access. |
.png)








Comments (6)
Mar 29, 2006
Anonymous says:
would like to {link-to} the 'remove' page feature, using the current page's id. ...would like to {link-to} the 'remove' page feature, using the current page's id. for example, to recreate the following hard url:
remove this page
replacing 970 with the current page id.
Can this be done with this plugin?
Mar 29, 2006
Guy Fraser says:
Not at present, but it should be fairly easy to add. I'll make a note in the iss...Not at present, but it should be fairly easy to add. I'll make a note in the issue tracker and it should appear in a new version of the plugin soon
Aug 07, 2006
Anonymous says:
I'm trying to use link-to: The 'add comment' target requires that a pag...I'm trying to use
but it is directing to viewpage.action?pageId=4188&showComments=true#addcomment which is the same as page comments. We're trying to get the link-to to open up the add comments section of the page for adding new comments. Any ideas?
Thanks,
Steve
steves@etr.org
Oct 10, 2007
Chris Walker says:
Hiya, Please add "Bookmarks" or similar option to reach the Space bookmarks pag...Hiya,
Please add "Bookmarks" or similar option to reach the Space bookmarks page in confluence 2.6+
Thanks!
Chris
Oct 10, 2007
Chris Walker says:
Ditto for user Watches, Drafts & Labels. More generally, you probably want ...Ditto for user Watches, Drafts & Labels. More generally, you probably want to check most/all of these handy tabs from Browse space & User profile have hooks in the macro syntax. Thanks guys!
Dec 18, 2007
Jennifer Connors says:
Space parameter doesn't seem to be working. Am I understanding it correctly? I...Space parameter doesn't seem to be working. Am I understanding it correctly?
I keep getting the msg link-to: The 'Employee & Room Phone Extensions' link target is not supported. I'd like to add link (plus others) to our theme.
Syntax I used:
Phone
Thanks.