# Overview

## What are Confluence User Macros ?

If you run your own Confluence instance (Server or Data Center) you can create custom “User Macros”, little scripts that can be included in pages creating content on the fly. With those macros you can create simple HTML code snippets as well as utilize Velocity code accessing information from your Confluence database.

I will not address the basics of writing a user macro here. That is well documented in the Confluence documentation [here](https://confluence.atlassian.com/doc/writing-user-macros-4485.html).

## My User Macros

Along my work as a Confluence administrator I ran into several situations where native Confluence Server features did not offer what admins or users needed. Plugins were not available either or too expensive for the purpose. In many of those cases I found that a user macro was just the right solution to the challenge. The Confluence user community helped me a lot writing them. Here are my most useful ones as my contribution back to that community.

{% hint style="info" %}

#### ![](https://2698388676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhxjY6Qy0WDq9YGYRZ50Q%2Fuploads%2FWWTgSBQTWzMPfcNnRsLz%2Fkgpg-32.png?alt=media\&token=a4a866aa-95d4-48ca-a865-ce098123b8c3) [Anonymous Access](https://github.com/glewe/confluence-user-macros/blob/master/src/anonymous-access)

This Confluence user macro lists all spaces for which 'Anonymous' has at least view permission.
{% endhint %}

{% hint style="info" %}

#### ![](https://2698388676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhxjY6Qy0WDq9YGYRZ50Q%2Fuploads%2F32wUVjAEA9mKK7xiXoN9%2Farts-32.png?alt=media\&token=9b787b1d-911d-4e00-a76c-80f34bcb60d6) [Audio Control](https://github.com/glewe/confluence-user-macros/blob/master/src/audio-control)

This Confluence user macro adds an HTML5 audio control element to your page that can play MP3, OGG and WAV files.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/blockquote/info-32.png?raw=true) [Blockquote](https://github.com/glewe/confluence-user-macros/blob/master/src/blockquote)

This Confluence user macro adds a styled blockquote to your page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/bootstrap-button/bootstrap-32.png?raw=true) [Bootstrap Button](https://github.com/glewe/confluence-user-macros/blob/master/src/bootstrap-button)

This Confluence user macro adds a Bootstrap 3 styled button, supporting different colors and sizes, and linking to a URL.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/bootstrap-progress-bar/bootstrap-32.png?raw=true) [Bootstrap Progress Bar](https://github.com/glewe/confluence-user-macros/blob/master/src/bootstrap-progress-bar)

This set of two Confluence user macros adds a Bootstrap like progress to your page, offering different coloring and animation options.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/chartjsv2/kchart-32.png?raw=true) [ChartJs v2](https://github.com/glewe/confluence-user-macros/blob/master/src/chartjsv2)

This set of Confluence user macros adds animated diagrams to your page based on Chart.js v2.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/colored-panel/window_list-32.png?raw=true) [Colored Panel](https://github.com/glewe/confluence-user-macros/blob/master/src/colored-panel)

This Confluence user macro adds a headed panel to your page with several coloring options.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/confluence-users-access/kgpg-32.png?raw=true) [Confluence Users Access](https://github.com/glewe/confluence-user-macros/blob/master/src/confluence-users-access)

This macro lists all spaces for which the group 'confluence-users' has at least view permission.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/expand-all/folder_orange_open-32.png?raw=true) [Expand All](https://github.com/glewe/confluence-user-macros/blob/master/src/expand-all)

This Confluence user macro adds a button group that toggles/expands/collapses all Expand sections on your page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/group-members/kdmconfig-32.png?raw=true) [Group Members](https://github.com/glewe/confluence-user-macros/blob/master/src/group-members)

This Confluence user macro adds a sorted table with numbered rows for each member of a given group.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/hide-if/hideif-32.png?raw=true) [Hide If](https://github.com/glewe/confluence-user-macros/blob/master/src/hide-if)

This Confluence user macro allows to hide content from users, groups or permissions.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/hide-sections/file_locked-32.png?raw=true) [Hide Sections](https://github.com/glewe/confluence-user-macros/blob/master/src/hide-sections)

This Confluence user macro hides different Confluence sections of your page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/horizontal-ruler/kruler-32.png?raw=true) [Horizontal Ruler](https://github.com/glewe/confluence-user-macros/blob/master/src/horizontal-ruler)

This Confluence user macro adds a customizable HR element to your page.
{% endhint %}

{% hint style="info" %}
![](https://github.com/glewe/confluence-user-macros/raw/master/src/legend/template_source-32.png?raw=true) \*\*\*\* [\*\*Legend\*\*](https://github.com/glewe/confluence-user-macros/blob/master/src/legend)

This Confluence user macro adds a legend box to the top right of the page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/local-time/clock-32.png?raw=true) [Local Time](https://github.com/glewe/confluence-user-macros/blob/master/src/local-time)

This Confluence user macro displays the user's local date and time offering several options. Use once per page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/marquee/knewsticker-32.png?raw=true) [Marquee](https://github.com/glewe/confluence-user-macros/blob/master/src/marquee)

This Confluence user macro adds an HTML5 marquee element to your page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/page-font/font-32.png?raw=true) [Page Font](https://github.com/glewe/confluence-user-macros/blob/master/src/page-font)

This Confluence user macro allows you to set a different font incl. size and color for your page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/page-permissions/kgpg-32.png?raw=true) [Page Permissions](https://github.com/glewe/confluence-user-macros/blob/master/src/page-permissions)

This Confluence user macro lists space permissions and page restrictions for the current page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/profile-info/vcard-32.png?raw=true) [Profile Info](https://github.com/glewe/confluence-user-macros/blob/master/src/profile-info)

This Confluence user macro displays a panel with the profile info of a single user or all users of a group.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/risk-matrix/risk-matrix-icon-32.png?raw=true) [Risk Matrix](https://github.com/glewe/confluence-user-macros/blob/master/src/risk-matrix)

Creates a risk matrix based on an issue type, likelihood field and impact field from a linked Jira instance.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/show-if/showif-32.png?raw=true) [Show If](https://github.com/glewe/confluence-user-macros/blob/master/src/show-if)

This Confluence user macro allows to show content only to certain users, groups or permissions.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/space-permissions/kgpg-32.png?raw=true) [Space Permissions](https://github.com/glewe/confluence-user-macros/blob/master/src/space-permissions)

This Confluence user macro lists users and groups having permissions to the current or given space.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/spacer/kget_list-32.png?raw=true) [Spacer](https://github.com/glewe/confluence-user-macros/blob/master/src/spacer)

This Confluence user macro adds a vertical space into your page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/telephone-link/chat-32.png?raw=true) [Telephone Link](https://github.com/glewe/confluence-user-macros/blob/master/src/telephone-link)

This Confluence user macro adds an HTML telephone link to your page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/tinylink/browser-32.png?raw=true) [Tiny Link](https://github.com/glewe/confluence-user-macros/blob/master/src/tinylink)

This Confluence user macro displays a link to the Tiny URL of the current page.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/tooltip/ktip-32.png?raw=true) [Tooltip](https://github.com/glewe/confluence-user-macros/blob/master/src/tooltip)

This Confluence user macro adds an inline text with a hover tooltip.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/user-permissions/kgpg-32.png?raw=true) [User Permissions](https://github.com/glewe/confluence-user-macros/blob/master/src/user-permissions)

This Confluence user macro lists all spaces in which a user has either View, Edit or Admin permission.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/video-control/aktion-32.png?raw=true) [Video Control](https://github.com/glewe/confluence-user-macros/blob/master/src/video-control)

This Confluence user macro adds an HTML5 video control element to your page that can play MP4 and OGG files.
{% endhint %}

{% hint style="info" %}

#### ![](https://github.com/glewe/confluence-user-macros/raw/master/src/youtube-video/youtube-32.png?raw=true) [YouTube Video](https://github.com/glewe/confluence-user-macros/blob/master/src/youtube-video)

This Confluence user macro adds a sizeable YouTube video frame to your page.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lewe.gitbook.io/confluence-user-macros/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
