Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-5245

Option to exclude current page in results when using contentbylabel macro

    • 33
    • 3
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      I am using the contentbylabel macro to list related topics; I do not want the current page listed in this list.

            [CONFSERVER-5245] Option to exclude current page in results when using contentbylabel macro

            Zac Xu added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 7.1.0
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Zac Xu added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.1.0 Upgrade now or check out the Release Notes to see what other issues are resolved.

            This would be super helpful to have from a knowledge management standpoint. 

            Noor Malik added a comment - This would be super helpful to have from a knowledge management standpoint. 

            Dmitry Ree added a comment -

            Another solution is to highlight the title of the current page in bold using space style sheets similar to the Page tree macro.

            Dmitry Ree added a comment - Another solution is to highlight the title of the current page in bold using space style sheets similar to the Page tree macro.

            ToBe added a comment - - edited

            Totally hope this will be available eventually.

            tl;dr (sry for potentially spamming the comments)

            One reason why someone might want to do this other than to "list other pages labeled X" is to have a parent page list all children, e.g. pages labeled X while also being listed once you click that label X, which you would do so you can find the "parent" also listed there. In other words, it's not necessarily just about excluding the "current page" but really any page, if not two pages: the supposed "parent" and @self.

            The pain point here for me is that it's not possible to define a page as a master or "parent" page for a label, displayed as a link at the view listing labeled pages when clicking the label, so I wouldn't have to tag a page with the label it's supposed to represent:

            This list shows content tagged with the following label: "foo".
            Also see: Some page explaining foo.

            The key to resolving this is thinking of labels more as parent-child relationships. So, for a label to be a wholesome first-class citizen in Confluence it needs to have at least one parent page, not just a listing of all the pages tagged with it, its children. Such "parent pages for labels" could even be qualified semantically, e.g. 

            • Father: Some page explaining Foo
            • Mother: Some page explaining Bar

            ...whereas only "Some page explaining Foo" and "Some page explaining Bar" would be "parent pages" to the label "foo".

            Well, you could take it even one step further and also want such "label-parent-qualifiers" to have associated pages that explain their right to exist, so "Mother" might point to a page "Some page explaining Mothers", etc... with awesome new filters that allow to aggregate all pages that have a label whose label-parent is "Foo" or all pages that are defined as label-parents where the qualified is "Mother", etc.... This would make labels way more semantic than the currently rather one-dimensional text association.

            ToBe added a comment - - edited Totally hope this will be available eventually. tl;dr (sry for potentially spamming the comments) One reason why someone might want to do this other than to "list other pages labeled X" is to have a parent page list all children, e.g. pages labeled X while also being listed once you click that label X, which you would do so you can find the "parent" also listed there. In other words, it's not necessarily just about excluding the "current page" but really any page, if not two pages: the supposed "parent" and @self. The pain point here for me is that it's not possible to define a page as a master or "parent" page for a label , displayed as a link at the view listing labeled pages when clicking the label, so I wouldn't have to tag a page with the label it's supposed to represent: This list shows content tagged with the following label: "foo". Also see: Some page explaining foo . The key to resolving this is thinking of labels more as parent-child relationships. So, for a label to be a wholesome first-class citizen in Confluence it needs to have at least one  parent page , not just a listing of all the pages tagged with it, its children . Such "parent pages for labels" could even be qualified semantically, e.g.  Father : Some page explaining Foo Mother : Some page explaining Bar ...whereas only " Some page explaining Foo"  and " Some page explaining Bar" would be "parent pages" to the label "foo". Well, you could take it even one step further and also want such "label-parent-qualifiers" to have associated pages that explain their right to exist, so " Mother " might point to a page " Some page explaining Mothers ", etc... with awesome new filters that allow to aggregate all pages that have a label whose label-parent is "Foo" or all pages that are defined as label-parents where the qualified is "Mother", etc.... This would make labels way more semantic than the currently rather one-dimensional text association.

             Yes, this seems like a common sense option. It is a bit daft displaying the current page you are on and should only display other articles which could be related.

            Tom Ireland added a comment -  Yes, this seems like a common sense option. It is a bit daft displaying the current page you are on and should only display other articles which could be related.

            Thanks Richard – adding "content != currentContent()" works great for me.

            Sharon Metzger added a comment - Thanks Richard – adding "content != currentContent()" works great for me.

            The fix https://jira.atlassian.com/browse/CONFSERVER-38589 makes this possible by editing the storage format:

            <ac:parameter ac:name="cql">label = "my-label" and content != currentContent()</ac:parameter>

            It would be nice to be able to set this via the macro UI, however.

             

            Richard George added a comment - The fix https://jira.atlassian.com/browse/CONFSERVER-38589  makes this possible by editing the storage format: <ac:parameter ac:name="cql">label = "my-label" and content != currentContent()</ac:parameter> It would be nice to be able to set this via the macro UI, however.  

            +1.  Atlassian, as others have asked, is there any reason to be hopeful about this being fixed?  I agree with all the others...this seems like a no-brainer.

            Tom Scheller added a comment - +1.  Atlassian, as others have asked, is there any reason to be hopeful about this being fixed?  I agree with all the others...this seems like a no-brainer.

            Thanks Stephen, The workaround works fine for us in the At the end of the BODY section as described and does not break the dashboard. Looking forward to this being an included feature in this macro.

            Michael Harris added a comment - Thanks Stephen, The workaround works fine for us in the At the end of the BODY section as described and does not break the dashboard. Looking forward to this being an included feature in this macro.

            Thanks for your workaround script, Stephen. Unfortunately, it seems to also break the Confluence dashboard. I'll try to fiddle with it and post the solution here if I find one.

            On-topic: this feature seems like a no-brainer. It should be a really simple addition to the underlying query. Not sure why this has been open for ten years...

            Wouter Veeken added a comment - Thanks for your workaround script, Stephen. Unfortunately, it seems to also break the Confluence dashboard. I'll try to fiddle with it and post the solution here if I find one. On-topic: this feature seems like a no-brainer. It should be a really simple addition to the underlying query. Not sure why this has been open for ten years...

              mbereznitsky Mark Bereznitsky
              vidya@atlassian.com Vidya Madabushi
              Votes:
              126 Vote for this issue
              Watchers:
              73 Start watching this issue

                Created:
                Updated:
                Resolved: