I'm looking for a way to create a page that holds two “filter by label” macros, with the label passed to the macros via a page level variable.
What I'm trying to achieve is to display two based on a label but without creating a separate page for each label. Ideally, a single page would be controlled by one filter setting and update the rest of the content accordingly.
Is there anyway to achieve this?
Short answer: this is not possible as far as I know with the native Filter by Label (Content by Label) macro on its own. Its label field holds static text or a CQL query, so it cannot read a page-level variable and refresh both macros from a single control.
If you are open to Marketplace apps, there are some out there. But if it must stay fully native, a lightweight custom macro built with Forge or Connect can take the label as a parameter and return content by that label. That gives you the single per-page control you are describing, at the cost of a little development effort.
Do you want to keep this native only, or are you happy to add an app?
Cheers, Martin
If I understand you correctly, what you're describing is 'conditional content' or 'content variants'.
For example, in my proof-of-concept - https://universal-imports.scrollhelp.site/datasink/Working-version/windows/troubleshooting-common-issues - I have single Confluence page but it contains content that's specific for Mac, Windows, or Linux variants.
It doesn't look like Confluence, but the underlying asset is a single page in Confluence and the selection works in Confluence too. See here:
I achieved this using K15t's Scroll Content Manager' Variants feature.
And crucially, it is label-based.
Disclaimer: I work for K15t. The article I'm referencing above is from my pre-K15t era.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Rhys,
The native Filter by Label macro can use labels or a CQL query configured inside the macro. Still, it can’t read a page-level variable or inherit a shared value that dynamically updates multiple macros. Each macro keeps its own configuration, so there isn’t a native page control that can switch both results together.
Since you’d like to avoid creating a separate page for every label, could you clarify how you expect someone to choose the label? For example, should the label come from the current page’s own label, a dropdown that a viewer changes while reading the page, or a value entered when the page is created from a template?
That distinction is important because using the current page’s label may have a different app-based solution than building an interactive viewer-controlled filter. Confluence Cloud doesn’t natively provide either behavior through the Filter by Label macro alone, but knowing which interaction you need would help narrow down a suitable Marketplace option.
Thanks,
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.