Skip to end of metadata
Go to start of metadata

There are a number of special tokens that can be used when defining widgets - when the widget gets rendered, these tokens are replaced with generated values such as the user's name, etc.

You can use tokens both in the widget title and the widget body (regardless of the rendering mode set for the widget body).

Token

Notes

Bubbles Version

%ceoid%

The database ID for the content entity object (page, blogpost, space, comment, etc.) in which the widget is being rendered.

1.0

%ceotitle%

The title of the content entity object in which the widget is being rendered.

1.0

%excerpt%

The excerpt text of the content entity object in which the widget is being rendered.

1.0

%creator%

The username of the user that created the content entity object in which the widget is being rendered.

1.0

%creatorfullname%

The full name of the user that created the content entity object in which the widget is being rendered.

1.0

%labels%

The labels associated with the content entity object in which the widget is being rendered.

1.0

%tinyurl%

The tiny URL of the content entity object in which the widget is being rendered.

1.0

%key%

The space key of the space in which the widget is being rendered.

1.0

%spacetitle%

The title of the space in which the widget is being rendered.

1.0

%spacedescription

The description of the sapce in which the widget is being rendered.

1.5.1

%owner%

The username of the person that created the space in which the widget is rendered.

1.0

%ownerfullname%

The full name of the person that created the space in which the widget is rendered.

1.0

%teamlabels%

The team lables associated with the space in which the widget is rendered.

1.0

%spacelabels%

The space lables associated with the space in which the widget is rendered.

1.0

%user%

The username of the logged-in user that's viewing the widget.

1.0

%userfullname%

The full name of the logged-in user that's viewing the widget.

1.0

%baseurl%

The Base URL value for the wiki, as defined in General Configuration.

1.0

%sitetitle%

The Site Title of the wiki, as defined in General Configuration.

1.0

%contextpath%

The context path for the web page in which the widget is being rendered.

1.0

 Colour Scheme Widget Tokens

The space colour scheme values are also available as Widget tokens. This allows you to include colours in your widget based on the theme applied to the space the widget is rendered in.

The following tokens are available

Token

Bubbles Version

%property_style_bordercolour%

1.1

%property_style_breadcrumbstextcolour%

1.1

%property_style_headingtextcolour%

1.1

%property_style_linkcolour%

1.1

%property_style_menuitemselectedbgcolour%

1.1

%property_style_menuitemselectedtextcolour%

1.1

%property_style_menuitemtextcolour%

1.1

%property_style_menuselectedbgcolour%

1.1

%property_style_navbgcolour%

1.1

%property_style_navselectedbgcolour%

1.1

%property_style_navselectedtextcolour%

1.1

%property_style_navtextcolour%

1.1

%property_style_spacenamecolour%

1.1

%property_style_topbarcolour%

1.1

%property_style_topbarmenuitemtextcolour%

1.1

%property_style_topbarmenuselectedbgcolour%

1.1

Should a token not be applicable, the %whatever% will be replaced with an empty string (so you don't start seeing "%whatever%" text in your widgets).

Examples

Let's say you wanted to display a link to the logged-in user's profile within a widget, you'd use:

View your profile: [~%user%]

When the widget gets rendered, %user% will be replaced by the username of the logged in user, for example "gfraser", leaving you with the wiki notation for a link to their profile:

View your profile: [~gfraser]

Velocity Variables

If your widget is using a rendering mode that incorporates velocity rendering, you can use velocity variable versions of the tokens by prefixing the token name with "widgetMacro_".

For example, instead of this:

%sitetitle%

You can use this:

${widgetMacro_sitetitle}

(The replacement of %tokens% happens before the widget is rendered through the velocity engine.)

  • No labels