Content by Label Macro
The Content by Label macro is used to display lists of pages, blog posts or attachments that have particular labels. It's great for collecting related pages together and filtering out content that you don't want to see.
For example, you could use this macro to display a list of all pages that have the label 'feature-shipped' and include the word 'Blueprint', or to list any pages with the label 'meeting-notes' that you've been mentioned in.
Here's how the macro looks on your page:
And here's how you would set it up in the macro browser:
Using the Content by Label Macro
To add the Content by Label macro to a page:
- From the editor toolbar, choose Insert > Other Macros
- Find and select the required macro
Speed it up with autocomplete: Type { and the beginning of the macro name, to see a list of suggested macros. In this example we're inserting the cheese macro.
To edit an existing macro: Click the macro placeholder and choose Edit. This will open the macro details, so you can edit the macro parameters.
CQL filters
Use the Add a filter link to add more filters to your query.
You can use the following CQL filters to build your query:
Filter | Description | Operators |
---|---|---|
Label* | Include pages, blog posts or attachments with these labels. | OR (multiple values in the same filter) AND (multiple Label filters) |
With ancestor | Include pages that are children of this page. This allows you to restrict the macro to a single page tree. | OR (multiple values in the same filter) |
Contributor** | Include pages or blog posts that were created or edited by these people. | OR (multiple values in the same filter) |
Creator | Include items created by these people. | OR (multiple values in the same filter) |
Mentioning user | Include pages and blog posts that @mention these people. | OR (multiple values in the same filter) |
With parent | Include only direct children of this page (further sub-pages won't be included) | EQUALS (one page only) |
In space** | Include items from these spaces. | OR (multiple values in the same filter) |
Including text** | Include items that contain this text. | CONTAINS (single word or phrase) |
With title | Include items that contain this text in the title. | CONTAINS (single word or phrase) |
Of type** | Include only pages, blogs or attachments. | OR (multiple values in the same filter) |
* This field is required in CQL-powered macros.
** You can add these filters in CQL-powered macros but in search they're part of the standard search filters, so they don't appear in the Add a filter menu.
Macro display options
These options control how the macro appears on your page.
Parameter | Default | Description |
---|---|---|
Sort by | Modified | Sort the list by title, the date it was created, or the date it was last modified. If you don't select an option, CQL default ordering by relevancy is used. |
Reverse sort | False | Sort the list descending instead of ascending (Z - A, earliest - latest) |
Maximum number of pages | 15 | Limit the number of items to include in the list. This can be any value up to 500 pages. |
List title | Blank | Include an optional heading for the macro |
Show labels for each page | True | Show or hide the labels applied to each item |
Show space name for each page | True | Show or hide the space name for each item |
Display excerpts | False | Allows you to include a short excerpt under each page in the list. Choose between:
|