Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a macro to show content with no labels?

Ste Griffiths May 20, 2019

Hi all,

I know about the Content by Label macro, but now I want to highlight (on the front page of our Confluence Knowledge Base) any pages which do not have any labels applied. This is to encourage users to go back and classify pages to make them more discoverable.

Is there a feature or a workaround to do this?

Cheers,
Ste

2 answers

1 accepted

0 votes
Answer accepted
Boris MBOUMEHANG
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2019

Hi Ste,

I think this could be done by using Confluence REST API. In fact, you can write a script performing the following actions:

  • Browse all the content of your Knowledge Base and getting the labels for each page. This could be a combination of:
  • Put the result you got on the front page of your Knowledge Base:

    curl --request PUT \
      --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id-for-KB_frontPage}' \
      --user 'email@example.com:' \
      --header 'Accept: application/json' \
      --header 'Content-Type: application/json' \
      --data '{
      "version": {
        "number": 19
      },
      "title": "",
      "type": "page",
      "status": "current",
      "ancestors": [
        {
          "id": ""
        }
      ],
      "body": {
        "view": {
          "value": "",
          "representation": "view"
        },
        "export_view": {
          "value": "",
          "representation": "view"
        },
        "styled_view": {
          "value": "",
          "representation": "view"
        },
        "storage": {
          "value": "",
          "representation": "view"
        },
        "editor2": {
          "value": "",
          "representation": "view"
        },
        "anonymous_export_view": {
          "value": "",
          "representation": "view"
        }
      }
    }'
    Extract of Confluence REST API page

 

Hope it will help you.

Regards,

Boris

Ste Griffiths May 22, 2019

Thanks for the work you put into this answer Boris. I think it's a little more heavy duty than I was looking for. Maybe one day there will be a macro to support this :)

Thanks again.

Like Boris MBOUMEHANG likes this
Boris MBOUMEHANG
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2019

You are welcome Ste :)
I also hope that a macro will support this

0 votes
Victor Mutambuki
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2019

Ste,

Maybe have your users look into their Activity Stream and check for labels in their recent works. Activity Stream.

Also, for pages that are created in the same way, form and collect the same data, you can have a template, add labels to it, then having users create pages from templates.

Victor

Ste Griffiths May 22, 2019

Thanks for your answer Victor :)

Rab Tait May 23, 2019

I have a content management space that uses labels and templates, and buttons to add content based on the template. All templates include a zzzuncat label by default. When people add new content, they are supposed to label it from a small set of available labels and remove the zzzuncat label. I have an admin page where I have a search for pages with the zzzuncat to see if people have forgotten to label what's been added.

This works but is not without issue. I'm starting with an empty Content space, so I know that all content will be added using my templates. I also have a small number of users and a fairly small label set. For larger projects, it is probably not viable. I also can't cater for instances where people just remove zzzuncat and don't add other labels. But, as I've said, I have a small number of users who I know.

Using this has allows us to have a usable CMS in Confluence with content reuse and single source of content.

Like Boris MBOUMEHANG likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events