Skip to end of metadata
Go to start of metadata

Generates a single web-item link. Uses Confluence menu  items so that menus are automatically updated 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.

Categories: development

Storage Format

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

Wiki Markup

{web-item:parameter=value}

Parameter

Name

Description

Type

Default

Required

section

Section

The location or section that the item is contained in

string

 

(tick)

item

Item Key

The item key that identifies the item

string

 

(tick)

id

HTML ID

The html id to apply to the item

string

 

(error)

class

CSS Class

A css classname to apply to the link

string

 

(error)

tooltip

Tooltip

A tooltip to apply to the link

string

 

(error)

accesskey

Access Key

An access key to apply to the link

string

 

(error)

icons

Show Icons

Display the web item icon

boolean

true

(error)

showKey

Show Key

Display the web item section & key

boolean

false

(error)

name

Show Name

Display the web item name

boolean

true

(error)

description

Show Description

Display the web item description

boolean

false

(error)

force

Force link to be displayed

Ignore conditions and force the link to be displayed

boolean

false

(error)

divider

Divider

The divider between name/description/key

string

 

(error)

flag

Flag

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

string

 

(error)

notflag

Not Flag

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

string

 

(error)

 

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}

HTML Output

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

 

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>  

 

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>

 

Web UI - Web Items

Web Ui - Web Sections