[All Adaptavist Apps]

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the example above, "stuff to show" would only be shown if the content is being shown in "view" or "edit" mode and is also either a "page" or "blogpost".

Contexts, Modes and

...

Decorators

You can determine the context and mode for any page by viewing the page source using your browser. A HTML comment output at the top of all pages shows the context and mode for each page.

You can specify multiple contexts and modes by separating them with commas as shown in the usage example earlier. For the macro content to show, all contexts and modes specified must match.

Some common contexts and modes are listed below, along with the associated menulink macro settings to create links to them.

Modes for context: page

All of these modes have a context of page and apply when working with content pages (including the Space home page):

Mode

Notes

Menulink

view

Normal view of a page, including when adding comments to a page

normalView

edit

Edit view of an existing page (see space-pages context for details of adding or copying pages).

edit

view-attachments

Viewing attachments on a page.

pageattachments

view-information

Displaying page information.

information

Modes for context: space-blogposts

This mode relates to the view of recent blogposts in a space:

Mode

Notes

Menulink

view-blogposts

List of recent blogposts in a space.

news

Modes for context: space-labels

All of these modes have a context of space-labels and relate to the label views within spaces.

Mode

Notes

Menulink

view-labels-popular

View popular labels

labels

view-labels-all

View all labels

 

Modes for context: space-attachments

This mode applies to the index of attachments within a space:

Mode

Notes

Menulink

view-attachments

Index of space attachments.

spaceattchments

Modes for context: space-administration

All space administration pages have a single mode as far as we can tell:

Mode

Notes

Menulink

view-space-administration

Any page within space admin area, regardless of whether you are viewing or editing, etc.

spaceadmin and configuretheme

Modes for context: space-pages

All of these modes have a context of space-pages and apply to standard space features such as the alphabetical index and site map.

Mode

Notes

Menulink

create-page

Applies when creating a new page or copying an existing page.

newpage and copy

list-recently-updated

List of recently updated pages.

recent

list-alphabetically

Alphabetical page index.

index

list-content-tree

Site map (i.e. pages tree view).

map

Modes for context: global

These modes relate to global (outside a space) locations:

Mode

Notes

Menulink

rss

RSS Feed Builder

RSS

Expand
View example...
View example...

If you view the HTML source of this web page you'll see the following:

No Format

<!-- main.vmd
  themebuilder : 'com.adaptavist.confluence.sitebuilder.SiteBuilderVelocityHelper@524c9770'/'$themebuilder.initialise'
  spaceKey : 'USERGUIDE'
  pageId : '10583'
  currentURL : '/pages/viewpage.action?spaceKey=USERGUIDE&title=builder-show+macro&focusedCommentId=11666379'
  contextPath : ''
  spaceName : 'User Guides'
  decorator : '$decorator'
  printable : 'false'
  mailId : '$mailId'
  mode : 'view'
  context : 'page'
-->

You can specify multiple contexts and modes by separating them with commas as shown in the usage example earlier. For the macro content to show, all contexts and modes specified must match.more to follow (smile)

Examples

Expand
Display content on news items
Display content on news items

To display some content only on news items (blogposts), you must use the macro within a panel in the Builder theme:

Code Block
{builder-show:context=news}
{menulink:news}Back to News Summary{menulink}
{builder-show}

...