{use-layout} macro
Requires Theme Builder 3 or above
This macro allows you to automatically change the layout used for a specific page, optionally latching that layout for the rest of the user's session.
page under construction - see wiki notation guide (when editing a page using wiki markup mode) for more info
| Parameter | Mandatory | Default | Notes |
|---|---|---|---|
| default | The ID of the layout to use | ||
| latch | false | Whether to latch the layout for subsequent page views throughout the site:
|
{use-layout:LAYOUTID}
{use-layout:LAYOUTID|latch=true}
Hints and Tips
You can use this macro to create URLs for mobile phone users, etc., that will automatically select an appropriate layout when accessed.
.png)








Comments (12)
Aug 27, 2009
David Chapman says:
I'm looking at implementing a light weight layout for PDA devices. The problem ...I'm looking at implementing a light weight layout for PDA devices. The problem I'm running into is our default layout is pretty heavy and even 3G phones tremble trying to load it. Is there a way to detect the user agent and redirect accordingly?
I know this isn't entirely related.
Aug 27, 2009
Alain Moran says:
{builder-show:agent=String to be present in user agent} ... {builder-show} buil...{builder-show:agent=String to be present in user agent} ... {builder-show}
builder-show macro
Oct 02, 2009
Simon Wheatley says:
Is it possible to trigger the use-layout behaviour with a URL GET parameter, as ...Is it possible to trigger the use-layout behaviour with a URL GET parameter, as below?
http://example.com/display/SPACEKEY/some-page?use-layout=LAYOUTID&latch=false
Oct 02, 2009
Guy Fraser says:
builder-show/hide macros have URL-based switching in recent versions. EDIT: I t...builder-show/hide macros have URL-based switching in recent versions.
EDIT: I think? Check the notation guide for the macros (the docu in this space might not be up to date)
Oct 02, 2009
Simon Wheatley says:
Ah. So (after you explained it to me on IM ) I think I understand: {builder-s...Ah. So (after you explained it to me on IM
) I think I understand:
{builder-show:....}{use-layout:...}{builder-show}It doesn't look like there's the ability in builder-show to inspect GET params on the URL. Would this be possible/difficult to add?
Oct 05, 2009
Alain Moran says:
the use-layout functionality is a by-product of the url GET functionality ... ie...the use-layout functionality is a by-product of the url GET functionality ... ie: the url GET functionality came first!!!!
the parameters you are looking for are layout=XXXX&latch=true
Oct 06, 2009
Simon Wheatley says:
That's excellent. Thanks Alain!That's excellent. Thanks Alain!
Mar 05, 2010
John Dassatti says:
Is there a way to use use-layout and latch to the default confluence theme? Or ...Is there a way to use use-layout and latch to the default confluence theme? Or make certain action pages use the default confluence theme instead of theme builder themes?
Mar 05, 2010
Alain Moran says:
Not exactly - the confluence theming architecture doesn't allow anything remotel...Not exactly - the confluence theming architecture doesn't allow anything remotely resembling use-layout or the layout= url parameter, once a theme has been chosen for a space then you are stuck with that theme.
However there is a workaround ... you can install the CONFLUENCE210 layout and set that as your default builder layout & switch about between builder layouts as needed.
I would recommend using Builder 4.0.2 or later for this since in 4.0.2 we have resolved many of the issues that the builder menu code was having with the confluence jQuery driven links - there are still some outstanding problems with the favourite & watch links, however these are close to being resolved
Feb 16, 2011
Dave Furlani says:
Rant retracted. Functionality found under View, other pages menu.Rant retracted. Functionality found under View, other pages menu.
Feb 16, 2011
Alain Moran says:
If you wish to reproduce the standard atlassian look & feel then install the...If you wish to reproduce the standard atlassian look & feel then install the Confluence 2.10 layout & base your layout on that.
The default builder layout is kept as basic as possible to avoid interfering with any customisations that you wish to build on top of it.
As to the lack of pre-built layouts - yes we know this is an issue, however the layouts we build for clients belong to those clients, as such we are not at liberty to give them away.
If however you build a layout & would like to contribute to the Layout Library then feel free to create an issue on http://tracker.adaptavist.com and I'll do my best to check through it for anything untoward & then post it up to the library crediting you for it's creation.
Apr 04, 2011
Ville Valtasaari says:
Can latching be used so that it only applies to a given layout. If I create a li...Can latching be used so that it only applies to a given layout. If I create a link that changes and latches a layout, the latch would only apply to pages that use a specific layout. Can I check for a latch?
Regards,
Ville