[All Adaptavist Apps]

Page tree

{builder-sidebar} Macro

Description

This macro is used to force the collapse/display of the sidebars on a page-by-page basis.

Usage

{builder-sidebar:right|collapse=true} 

Note:
This macro should be used only once, usually inside a panel within the theme configuration screen.

Parameters

Property

Required

Default

Notes

default

(tick)

true

the sidebar to be affected (left/right)

collapse

(error)

false

should the sidebar be collapsed? (true/false)

force

(error)

false

override any cookie stored value for the state (true/false - default false)

Examples

Simply add the macro to a panel in the theme configuration or to a page to make the right or left sidebar appear or collapse by default:

{builder-sidebar:right|force=true}

CSS Customisation

N/A

Hints and Tips

None at present.

Frequently Asked Questions

None at present.

  • No labels

12 Comments

  1. Unknown User (p)

    Hi,

    I'm using Theme Builder 3.3.4 and trying the following: on all my pages I want the left side bar to appear, filled with the pagetree, except for my (customized) dashboard.

    I've been playing with different locations to put this builder-sidebar macro, but am not achieving the correct result. either it's always there, or it's never displayed.

    How can I best achieve the desired result?

    TIA,

    P

    1. Unknown User (davidchapmanattpt)

      I'm running into a similar issue. It seems the collapse status persists via cookie so you cannot expect it to default to a particular state.

  2. Unknown User (davidchapmanattpt)

    For our layout we're trying to force a left sidebar on the root of each space to include a navigation and some basic information for that space but I'm having some problems with the builder-sidebar. It seems its state persists such that if I turn it off on one page, it stays off.

    Is there a way to default it to one and not allow its state to persist?

    Currently I'm doing the following which doesn't catch all the possibilities and doesn't give me the flexibility I need.

    {builder-hide:page=@parent|context=page|mode:view}
    {builder-sidebar:left|collapse=false|force=true}
    {builder-hide}
    {builder-show:page=@parent|context=page|mode:view}
    {builder-sidebar:left|collapse=true|force=true}
    {builder-show}
    

    Ideally it would default to collapsed and I could just turn it on when the page does not have any parents, isn't an action and is in view mode.

    1. Unknown User (amoran)

      Sounds like you might be better off using two different layouts, one with a sidebar and one without.

      There is no way to disable the cookie storage of the state.

      Have you also considered using the options in the panel editor ... you should be using these for setting the default state and builder-sidebar as the override.

      1. Unknown User (davidchapmanattpt)

        Is it possible to have two layouts per space (one for the root/home page and one for the reset) ? I wouldn't be opposed to this if there's a way to set that up.

        I tried setting it to collapse by default and turning it on just for the root/home page of the space but it seemed to persist past that. Should it not? You mentioned options (plural) but I only see one that applies, the collapse by default. Is there one I'm missing or possibly looking at the wrong place?

        1. Unknown User (amoran)

          You can have as many layouts as you like applied to a space via the use-layout macro in conjunction with the builder-show macro ... the layout you select for the space is only the default layout (wink)

          You might like to consider using what I would call a 'switching layout' which contains little else than the header panel that contains a bunch of builder-show/hide logic which selects the layout through use-layout.

          1. Unknown User (davidchapmanattpt)

            I wasn't even aware of this macro. That sounds like an interesting concept and should meet my needs. Thanks!

  3. Unknown User (lfm@seafood.no)

    This is what your tutorial says:

    Simply add the macro to a panel in the theme configuration or to a page to make the right or left sidebar appear or collapse by default

    When I add the macro to a page, like this:

    {builder-sidebar:right|collapse=true}

    I get the following error message:

    "builder-sidebar: This macro may only be used within a builder panel"

    How can I make the sidebar collaps on a page-by-page basis?

    1. Unknown User (amoran)

      I would use labels or metadata and then control the sidebar using the builder-show macro

  4. Unknown User (jonnylyse)

    Hi, My goal is to open up the Right Sidebar when someone is making a new page or editing an old page. When they are viewing pages i want the sidebar to be hidden.

    The code in the RSB:
    I have tried enabling and disabling it, i have tried to use "Collapse this sidebar by default" but i cant make it work like described.

    Please advise (smile)

    {builder-sidebar:right|collapse=false}
    {builder-show:mode=create-page,edit}
    Help Tips
    
    Text formatting
    etc etc
    {compound-menuitem:notationguide|flat=true|caption=Full Notationguide}
    
    {builder-show}
    
    1. Unknown User (amoran)

      Create a sub-layout and use the use-layout macro instead.

      1. Unknown User (jonnylyse)

        After randomly stumpling upon : http://www.adaptavist.com/pages/viewpage.action?pageId=31589113
        (Help (Notatation) Tips missing in 3.30M3 + 2.9.1),
        I solved this by adding the sidebar to my Layout, which included only:
        {builder-infopanel}

        I set the sidebar to have no borders and set Position -> Overflow to Hidden.
        The site now looks to be without my RSB but when editing or creating a new page i get the RSB with the Notation Guiders. Just as intended! Problem solved.