"notifications" Macro

Last modified by Eleni Cojocariu on 2026/10/15 16:35

Reference

Description

The notifications Macro displays wiki events in the content of any page. In the macro list of the editors it appears as "Notifications".

Written without parameters it shows the most recent events of the current wiki, minus the reader's own. Its parameters move it in two directions: useUserPreferences turns it into the reader's own notifications, the ones the notifications menu shows, while wikis, spaces, pages, users and tags turn it into an activity stream for one part of the wiki.

The events are fetched after the page is displayed, so they appear a moment later. The macro shows count of them and ends with a "Load older notifications" button that fetches the next ones.

Usage

Write the macro on a line of its own. It takes no content, and every parameter is optional:

{{notifications /}}

It is a block macro, so it cannot sit inside a sentence. In an editor it is inserted like any other macro, under the name "Notifications".

The Select Macro dialog of the WYSIWYG editor, filtered on notifications, with the Notifications macro highlighted

Parameters

NameOptionalAllowed valuesDefault valueDescription
countyesa positive number10How many events are displayed at once.
useUserPreferencesyestrue or falsefalseWhether the reader's own notification settings decide what is displayed. With true, wikis, spaces, pages, users, displayWatchedUsersOnly and tags are ignored.
displayOwnEventsyestrue or falsefalseWhether the reader's own actions are displayed. They are hidden by default.
displayMinorEventsyestrue or falsefalseWhether edits saved as minor are displayed. They are hidden by default.
displaySystemEventsyestrue or falsefalseWhether the events XWiki itself triggers are displayed. They are hidden by default.
displayReadEventsyestrue or falsetrueWhether the events the reader has already marked as read are displayed.
displayReadStatusyestrue or falsetrueWhether each event shows its read or unread status. That marker is also what carries the control marking an event as read.
wikisyeswiki names, comma-separated The wikis whose events are displayed.
spacesyesspace references, comma-separated The spaces whose events are displayed.
pagesyesfull page references, comma-separated The pages whose events are displayed.
usersyesuser references, comma-separated The users whose events are displayed.
displayWatchedUsersOnlyyestrue or falsefalseWhether only the events of the people the reader follows are displayed. With true the macro replaces whatever users holds with that list, and a reader who follows nobody sees the message "You are not following anybody." instead of events.
displayRSSLinkyestrue or falsetrueWhether a link to the RSS feed of the same events is added below them.
tagsyestags, comma-separated Only the events of pages carrying one of these tags are displayed. It works on the current wiki only.

Examples

Displaying the Recent Activity of the Wiki

{{notifications count="5" /}}

A page displaying five recent events, each with its page, its author and how long ago it happened, above the button that loads older ones

Displaying the Activity of One Space

{{notifications spaces="Blog" count="5" displayOwnEvents="true" /}}

Displaying the Reader's Own Notifications

{{notifications useUserPreferences="true" /}}

Each reader then sees the events their own notification settings select, so the page shows something different to everyone.

FAQ

Can the macro display page creations only?

No parameter filters by event type. Set useUserPreferences to true, and each reader gets the event types they chose to receive.

The macro displays no event. Why?

Nothing matched its parameters. The macro hides the reader's own actions, minor edits and the events XWiki triggers itself unless displayOwnEvents, displayMinorEvents or displaySystemEvents says otherwise. A reader also never sees an event about a page they cannot view, so the same macro legitimately shows fewer events to some people than to others.

Related

Get Connected