Menu - Web Item

This macro generates a single Web Item link. It automatically uses Confluence menu items to update menus with new or deprecated menu items. Atlassian CSS classes are retained for consistent styling. See Web UI - Web Items for a list of Confluence link items and their location keys.

Usage

Storage Format

<ac:macro ac:name="web-item"> <ac:parameter ac:name="parameter">value</ac:parameter> </ac:macro>

Wiki Markup

{web-item:parameter=value}
ParameterNameDescriptionTypeDefaultRequired

section

Section

The location or section that the item is contained in

string


item

Item Key

The item key that identifies the item

string


id

HTML ID

The HTML id to apply to the item

string


class

CSS Class

A CSS classname to apply to the link

string


tooltip

Tooltip

A Tooltip to apply to the link

string


accesskey

Access Key

An access key to apply to the link

string


icons

Show Icons

Display the Web Item icon

boolean

true

showKey

Show Key

Display the Web Item section and key

boolean

false

name

Show Name

Display the Web Item name

boolean

true

description

Show Description

Display the Web Item description

boolean

false

force

Force link to be displayed

Ignore conditions and force the link to be displayed

boolean

false

divider

Divider

The divider between name/description/key

string


flag

Flag

A list of flags, one of which must be defined for the content to be displayed

string


notflag

Not Flag

A list of flags that must not be defined for the content to be displayed

string


Basic Example

Display a link to:

  • All Labels

    • Name it Custom All Labels

    • Add the class myclass to the link item

<ac:macro ac:name="web-item"> <ac:parameter ac:name="section">system.labels</ac:parameter> <ac:parameter ac:name="item">view-labels-all</ac:parameter> <ac:parameter ac:name="label">Custom All Labels</ac:parameter> <ac:parameter ac:name="class">myclass</ac:parameter> <ac:rich-text-body>Custom All Labels</ac:rich-text-body> </ac:macro> {web-item:section=system.labels|item=view-labels-all|label=Custom All Labels|class=myclass}Custom All Labels{web-item}

Result

HTML Output:

<a class=" myclass" href="/confluence/labels/listlabels-alphaview.action?key=AD">Custom All Labels</a>

Advanced Example

Display a link to:

  • All Labels

    • Name it All Labels

    • Add the ID, myid to the link item

    • Add the class, myclass to the link item

    • Do not show menu icons

    • Show the Web Location and Web Item keys

    • Show link names

    • Force Web Items to display out of context

    • Do not show if flag login is set

    • Add | between the name and location keys

    • Only show when flag With Sidebar is set

<ac:macro ac:name="web-item"> <ac:parameter ac:name="section">system.labels</ac:parameter> <ac:parameter ac:name="item">view-labels-all</ac:parameter> <ac:parameter ac:name="label">All Labels</ac:parameter> <ac:parameter ac:name="id">myid</ac:parameter> <ac:parameter ac:name="class">myclass</ac:parameter> <ac:parameter ac:name="icons">false</ac:parameter> <ac:parameter ac:name="showKey">true</ac:parameter> <ac:parameter ac:name="name">true</ac:parameter> <ac:parameter ac:name="force">true</ac:parameter> <ac:parameter ac:name="divider"> | </ac:parameter> <ac:parameter ac:name="flag">with-sidebar</ac:parameter> <ac:parameter ac:name="notflag">login</ac:parameter> </ac:macro>

Result

HTML Output:

<a id="myid" class=" myclass" href="/confluence/labels/listlabels-alphaview.action?key=AD">All Labels</a> <span class="key"> | system.labels:view-labels-all</span>
On this page