This documentation relates to Confluence 3.1.x
If you are using an earlier version, please view the previous versions of the Confluence documentation and select the relevant version.

Content by Label Macro

The Content by Label macro lists content which has been tagged with specific labels.

On this page:

Usage with the Macro Browser

To insert the content by label macro into a page using the Macro Browser,

  1. Open your desired Confluence page or blog post, then click the 'Edit' button. The page or blog post opens in edit mode.
  2. Click the Macro Browser icon on the toolbar. The macro browser window opens in the middle of the screen in 'macro selection' mode.
  3. Scroll through the list of macros. Alternatively, start typing part of the name of your desired macro into the search box at the top right of the macro browser window. Macros with a matching name will appear in the main pane.
  4. Click on the desired macro to access its parameters and preview parameter changes ('preview mode').
  5. Set the macro parameters to your requirements. If desired, you can preview these changes by clicking 'Refresh'.
  6. Click 'Insert' to put the macro into the page.

Once you've found the content by label macro, click 'insert' to add it to your page.

Usage with the Wiki Markup Editor

To display all pages with the label needs-fixing, use:

{contentbylabel:label=needs-fixing|showLabels=false|showSpace=false|maxResults=99|space=@self}

Below is a working example of the 'Content by Label' macro. In the example, we have restricted the display to 5 results. By default, Confluence lists all the labels for each result displayed. See the optional parameters below for more information.

What you need to type What you will get
{contentbylabel:label=documentation|maxResults=5}
Confluence Internals (Confluence 2.6) Labels: documentation, internal, confluence
Character encodings in Confluence (Confluence 2.6) Labels: documentation, internal, http, database, confluence, utf8, unicode, encoding, character
Character encodings in Confluence (Confluence 2.7) Labels: character, encoding, unicode, utf8, confluence, database, http, internal, documentation
Character encodings in Confluence (Confluence 2.8) Labels: documentation, internal, http, database, confluence, utf8, unicode, encoding, character
2. Installing Crowd and CrowdID (Crowd 1.3) Labels: crowd-home, crowdid, overview, api, crowd, documentation, guide
Showing first 5 of 246 results

Parameters

Parameters are options that you can include in Confluence macros to control the content or format of the macro output. The table below lists relevant parameters for this macro.

Parameter names are different in the macro browser and in wiki markup. Below we show the macro browser parameter names in bold text, and the equivalent wiki markup parameters in (bracketed) text. If we do not show any parameter name for the wiki markup, then you should leave out the parameter name and simply include the parameter value as the first parameter, immediately after the colon (:).

Parameter Default Description
(author) None Filter the results by author. The macro will display only the pages etc which are written or updated by the author(s) you specify here.

You can specify one or more authors, separated by a comma.
Label(s)
(label) or (labels)
None This parameter is required.

Use this parameter to filter the results by label. The macro will display only the pages etc which are tagged with the label(s) you specify here.

You can specify one or more label values, separated by a comma or a space.
  • To exclude content which matches a given label, put a minus sign (-) immediately in front of that label value. For example: If you specify a label value of -badpage you will get only content which is not labelled with 'badpage'.
  • To indicate that the results must match a given label value, put a plus sign (+) immediately in front of that label value. For example: If you specify a label value of +superpage,+goodpage you will get only content which has at least two labels, being 'superpage' and 'goodpage'.
Maximum Number of Pages
(max) or (maxResults)
15 Specify the maximum number of results to be displayed. Note that the results are sorted first, and then the maximum parameter is applied.
(operator) OR The operator to apply to the supplied lists of labels. By default, a page with any of the non-prefixed labels (that is, labels without a plus (+) or minus (-) sign immediately preceding it) will be listed. By using operator=AND, only pages with all of the supplied non-prefixed labels will be listed.

Be aware that this parameter only modifies the behaviour of the 'Label(s)' parameter and only affects label values without a plus (+) or minus (-) sign prefix. To avoid confusion or unexpected results, it is not recommended that the operator parameter be used in conjunction with any label values prefixed with '+' or '-' signs.
Show Labels for Each Page
(showLabels)
true Show or hide labels for results.
Show Space Name for Each Page
(showSpace)
true Show or hide spaces for results.
Reverse Sort
(reverse)
false Use this parameter in conjunction with the sort parameter described below. Set reverse=true to change the sort from ascending to descending.

this parameter is ignored if the sort parameter is not specified.
Sort By
(sort)
modified Specify how the results should be sorted. To change the sort order from ascending to descending, use the reverse parameter described above.

Note: If this parameter is not specified, the sort order defaults to descending order based on the last modification date.

Values:
  • creation — Sort by the date on which the content was added.
  • title — Sort alphabetically by title.
  • modified — Sort by the date on which the content was last updated.
Restrict to these Spaces
(space) or (spaces)
@all, i.e. all spaces in your Confluence site. This parameter allows you to filter content by space. The macro will display only the pages etc. which belong to the space(s) you specify here.

You can specify one or more space keys, separated by a comma or a space.
  • To exclude content in a specific space, put a minus sign (-) immediately in front of that space key. For example: If you specify a space key of -BADSPACE you will get only content which is not in the BADSPACE.
  • To indicate that the results must come from a specific space, put a plus sign (+) immediately in front of that space key. For example: If you specify a space key of +GOODSPACE you will get only content in GOODSPACE. (Note that this is not particularly useful, because each content item belongs to one space only. If you put a plus sign next to one space key and list other space keys too, the other space keys will be ignored.)

Special values:
  • @self — The current space.
  • @personal — All personal spaces.
  • @global — All global spaces.
  • @favorite — The spaces you have marked as favourite.
  • @favourite — The same as @favorite above.
  • @all — All spaces in your Confluence site.
  • * — The same as @all above.

When specifying a personal space, remember to use the tilde (~) sign in front of the username, such as ~jbloggs or ~jbloggs@example.com.

List Title
(title)
None Adds a title or heading to the list.
Include these Content Types Only
(type)
all This parameter allows you to filter content by content type. The macro will display only the content of the type you specify here.

You can specify one or more types, separated by a comma or a space.

To exclude content of a given content type, put a minus sign (-) immediately in front of that content type. For example: If you specify a content type of -blogpost you will get pages and all other content except for blog posts.


Available values:
  • pagePages.
  • blogpost or newsBlog posts, also known as news items.
Display Excerpts
(excerpts)
false Displays the first line of excerpts for each page.

Examples

1. Show content from a specific space

{contentbylabel:label=dogs,cats|space=PETS}

2. Show only results in current space

{contentbylabel:label=dogs,cats|space=@self}

3. Show results from all spaces

{contentbylabel:label=dogs,cats|space=@all}

4. Show only content of a specified type

The code below will show only pages (but not news items or other content types) with the labels 'dogs' or 'cats':

{contentbylabel:label=dogs,cats|type=page}

5. Do not show the labels in the results

{contentbylabel:label=dogs,cats|showLabels=false}

6. Do not show the space names in the results

{contentbylabel:label=dogs,cats|showSpace=false}

7. Display excerpts in the results

{contentbylabel:label=dogs,cats|excerpt=true}

8. Specify the maximum number of results to display

{contentbylabel:label=dogs,cats|max=99}

9. Sort by modification date

{contentbylabel:label=dogs,cats|sort=modified}

10. Change the sort order

{contentbylabel:label=dogs,cats|sort=modified|reverse=true}
RELATED TOPICS

Related Labels Macro
Navmap Macro
Recently Used Labels Macro
Working with Labels Overview
Working with Macros

Take me back to the Confluence User's Guide.

Labels

label label Delete
filterbylabel filterbylabel Delete
contentbylabel contentbylabel Delete
related related Delete
similar similar Delete
topic topic Delete
content content Delete
confluence-label-filter confluence-label-filter Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jan 11, 2008

    Anonymous says:

    I would like the output to be just the page names as links, separated by spaces....

    I would like the output to be just the page names as links, separated by spaces.  No icon, no "new line", no Space or Labels.  In this way I can, for example, create a table and fill a cell with links for a label-defined collection of pages.  A very dense way to build a reference page to items for sets of topics. Please!?

    Is this doable as a user macro?  Would the current source be a big help?

    Thanks! - Tom Evans 

    1. Jan 14, 2008

      Anonymous says:

      Here is a great example of how this capability would be used:   enter...

      Here is a great example of how this capability would be used:

        enterprisearchitecture.nih.gov
       

      The front page of this Enterprise Architecture site gives instant access to a large set of standards, organized by category.  A perfect use of  labels and content-by-label.  If these links were listed as one-per-line this Front Page would be three pages long, at least.

      1. Jan 14, 2008

        James Mortimer says:

        you could use the Reporting Plugin (if it's installed) you could use this hor...
        • you could use the Reporting Plugin (if it's installed)
        • you could use this horrible user macro hack below. Uses metadata-report from the Metadata Plugin. By using metadata-report, you can use basic label logic, i.e. 'software+documentation' requires both labels. you could alter it to wrap the built in contentbylabel aswell.
        • the trimp and render velocity template definitions may not be needed if they are declared elsewhere
        ## Macro: contentbylabel2
        ## Macro does not have a body
        ## Macro returns HTML
        ##
        #macro(trimp $xhtml)
        ## remove leading <p> and trailing </p>
        #if($xhtml.startsWith("<p>",0) && $xhtml.endsWith("</p>"))
        #set($len=$xhtml.length()-$generalUtil.convertToInteger(4))
        #set($xhtml=$xhtml.substring(3,$len))
        #end
        $xhtml
        #end
        ##
        #macro(render $wiki)
        ## render $wiki in wiki renderer
        #set($globalHelper=$action.getGlobalHelper())
        #if($content) ## i. e. we render a normal page
          #set($renderer=$globalHelper.getWikiStyleRenderer())
          #set($context=$content.toPageContext())
          #set($xhtml=$renderer.convertWikiToXHtml($context, $wiki))
        #else ## we are e. g. in Global Template Preview
          #set($xhtml=$globalHelper.renderConfluenceMacro($wiki))
        #end
        #trimp($xhtml)
        #end
        ##
        ## Get parameters
        ##
        #set($key="")
        #if($paramkey)#set($key=$paramkey)#end
        #if($key.length()>0)#set($key="|key=$key")#end
        ##
        #set($sort="")
        #if($paramsort)#set($sort=$paramsort)#end
        #if($sort.length()>0)#set($sort="|sort=$sort")#end
        ##
        #set($delimiter=" ")
        #if($paramdelimiter)#set($delimiter=$paramdelimiter)#end
        ##
        #set($labels="")
        #if($param0)#set($labels=$param0)#end
        #if($paramlabels)#set($labels=$paramlabels)#end
        #if($labels.length()>0)#set($labels="|labels=$labels")#end
        ##
        ## retrieve pages with those labels (uses metadata-report for now)
        ##
        #set($wiki="{metadata-report:Title${labels}${key}${sort}}")
        #set($html="#render($wiki)")
        ##
        ## pull out just urls, skipping first array element
        ##
        #set($hrefs=$html.split('<a href='))
        #foreach($href in $hrefs)
        #if($velocityCount>1)
        #set($index=$href.indexOf("</a>")+$generalUtil.convertToInteger(4))
        #set($href="<a href=$href.substring(0,$index)")
        #if($velocityCount>2)
        $delimiter
        #end
        $href 
        #end
        #end
        
        1. Jan 14, 2008

          Anonymous says:

          Wow. Thanks! This client site needs to get through an upgrade first (2.0.2 ...

          Wow. Thanks!

          This client site needs to get through an upgrade first (2.0.2 -> 2.7), so I won't be reporting success for (at least) a few weeks, but its great to see a solution, and community support in action.  - Tom

  2. Apr 30, 2008

    Jes Deamer says:

    Is there anyway to do some kind of exclusion criterion? say contentbylabel: '...

    Is there anyway to do some kind of exclusion criterion? say

    contentbylabel: '!needs_review' is an invalid label.

    The practical application would be having a set of documents on varying yet very similar topics, wanting to display all except a particular subset that is flagged for review. Since I'd need to use more than one set of labels, I'm hard pressed to say ONLY dogs and reviewed, as I need cats as well, so setting the AND operator doesn't catch all the content, and OR sets the net too wide.

    1. Apr 30, 2008

      David Peterson [CustomWare] says:

      You can do it with the Reporting Plugin. The 'labels' parameters on several macr...

      You can do it with the Reporting Plugin. The 'labels' parameters on several macros there will let you specify "+" or "-" for "required" and "excluded", respectively. So, for example, you could do this:

      {report-list}
      {content-reporter:space=+@global, -EXCLUDED|labels=+dogs, +cats, -needs_review|type=page}
        {text-sort:content:title}
      {content-reporter}
      
      {report-body}{report-info:content:title|link=true}{report-body}
      
      {report-list}
      

      Which would basically give you all pages in all global (non-personal) spaces except the one called 'EXCLUDED' which have the 'dogs' and 'cats' label, but do not have 'needs_review'.

  3. Sep 05, 2008

    Anonymous says:

    I see where the type "page" and blog-post" work, but I dont; see a full list fo ...

    I see where the type "page" and blog-post" work, but I dont; see a full list fo other "types"

     in the search macro documentation I see a list of types- but they don't seem to be consistent -- I see "userinfo",  but I can't get any of these to work using this contentby label macro:

    userinfo, user-indo, user, users, profile, profiles, user-profile....

     in the search macro I see "blogpost" type but in this macro it is blog-post...  Is there some consistency that will be achieved here at some point? what types does this macro support right now? if not all- why?


    1. Sep 29, 2008

      Ming Giet Chong says:

      Hi, For Content by label macro, it's different with the space macro whereby it ...

      Hi,

      For Content by label macro, it's different with the space macro whereby it lists content with tagged labels. That means, it could be either page or blogs post. Having said that, labels work in pages and blogs post. In this macro, the "blogpost" type is used. For example:

      {contentbylabel:dogs|type=blogpost}
      

      Hope this helps. Thanks.

      Regards,
      MG

  4. Sep 15, 2008

    Anonymous says:

    Can you pull attachments in with this macro?  Say I am pulling all pages wi...

    Can you pull attachments in with this macro?  Say I am pulling all pages with the labels Forms and Policies.  Though all of our forms and policies are attachments.  Could it look like this?

     IT Forms and Policies:

    - Internet usage policy (Actual link to the word document policy)

    - Email Policy (Actual link to the word document policy)

    1. Sep 16, 2008

      Azwandi Mohd Aris [Atlassian] says:

      Hi there, I am afraid that this is not possible since the supported content typ...

      Hi there,

      I am afraid that this is not possible since the supported content types are page and blogpost only. The attachment macro might be the closest to your requirement, however there is no labelling capabilities.

      However, there is an ongoing feature request at CONF-3963 to allow attachments to be labelled, and hence can be further utilised by the attachment macro to filter out the attachments according to labels: CONF-9639. Hope that helps.

      Cheers,
      Azwandi

  5. Jan 09, 2009

    Tomi Strugar says:

    In Conf 2.7.3, if no content in the space in which you were searching didn't hav...

    In Conf 2.7.3, if no content in the space in which you were searching didn't have the label (e.g. labelx) you were looking for, the macro would return the text:

    No content found for label(s) labelx.

    In 2.10.1, the macro returns

    contentbylabel: 'labelx' is not an existing label

    This text is also highlighted in red and looks like a system error to the user.

    What can be done to fix this back to the way it used to be?

    Wiki markup:

    {contentbylabel:labelx|key=@self|showLabels=false|maxResults=99|excerpt=true|showSpace=false}
    
    1. Jan 14, 2009

      Tomi Strugar says:

      Bug reported to Atlassian: CSP-27601

      Bug reported to Atlassian: CSP-27601

      1. Sep 10

        Vinay Konanki says:

        Hi Tomi, We are having similar problem with confluence 2.6 and confluence 2.10....

        Hi Tomi,

        We are having similar problem with confluence 2.6 and confluence 2.10.3. Any update on this issues? I can not see the issue CSP-27601.

        Thx.

        1. Sep 14

          Zed Yap [Atlassian] says:

          Hi Vinay, We are having similar problem with confluence 2.6 and confluence 2.10...

          Hi Vinay,

          We are having similar problem with confluence 2.6 and confluence 2.10.3. Any update on this issues?

          I have double check the issue CSP-27601. However, there is not much information in that issue. Also, I believe that the warning information is fix in plugin version 1.5.5. I have personally tried this, an it display same as in Confluence 2.6. Please give it a try.

          Hope that helps,
          Best rgds
          Zed

  6. Jan 11, 2009

    David Mittman says:

    I'd like to create a "Related Topics" section on a page that lists the pages tha...

    I'd like to create a "Related Topics" section on a page that lists the pages that are related to the current page using the page labels as the associative element. If I'm reading the documentation correctly, the contentbylabel macro requires a label or labels as a parameter. It seems odd to have to provide labels as input to the macro, when I've already added labels to the page. Is there any way to have the contentbylabel macro use the current page's labels as the value of the label/labels parameter? I'm using Confluence 2.8.2, but plan on upgrading to the latest release soon.

    Thanks.

    1. Jan 12, 2009

      Azwandi Mohd Aris [Atlassian] says:

      Hi, David. If I am not wrong, you can use the {related-labels} macro to achieve ...

      Hi, David. If I am not wrong, you can use the {related-labels} macro to achieve this. Hope that helps!

      1. Jan 12, 2009

        David Mittman says:

        I believe the {related-labels} macro produces a formatted listing of labels rela...

        I believe the {related-labels} macro produces a formatted listing of labels related to the labels used on the current page. I'm looking for a formatted listing of pages like the one provided by the {contentbylabel} macro, and the listing should contain the pages related to the labels on the current page. If I were to use the {related-labels} macro, and somehow feed those results to the {contentbylabel} macro, I'd end up with a much larger listing of related pages, sort of an extended family of pages.

        1. Feb 08, 2009

          Brad Rosenberg says:

          David, I wanted the same thing and just recently created the following user macr...

          David, I wanted the same thing and just recently created the following user macro: http://confluence.atlassian.com/display/CONFEXT/Related+Content+User+Macro that I believe suits your needs.

          1. Aug 07, 2009

            Anonymous says:

            I was looking for the same thing and this user macro did the trick - Thanks. May...

            I was looking for the same thing and this user macro did the trick - Thanks.
            Maybe the staff can add this information on the bottom of the page (So it doesnt get lost in comments)

            1. Aug 07, 2009

              Brad Rosenberg says:

              Glad the user macro worked out for you. Let me know if there's an additional fea...

              Glad the user macro worked out for you. Let me know if there's an additional feature you'd like to see supported.

  7. Jan 28, 2009

    Christian Bering says:

    I've added this macro to a number of pages, but I get "No content found for labe...

    I've added this macro to a number of pages, but I get "No content found for label(s)" all the time, evn though I know results exist for the search. I've tried rebuilding the index, but that doesn't help. Any suggestions?

    1. Jan 28, 2009

      Mark Hrynczak [Atlassian] says:

      Hi Christian, If you are using 2.10, then by default the macro will return matc...

      Hi Christian,

      If you are using 2.10, then by default the macro will return matches from the current space only. You can specify which spaces to include results from by using the 'space' parameter, or just add 'space=@all' to return results from the entire site.

      If that is not the problem, I would suggest raising a support request at https://support.atlassian.com/secure/Dashboard.jspa.

      Thanks,
      Mark

    2. Feb 16, 2009

      Guillermo Chutrau says:

      Try: {contentbylabel:yourlabel|...everything else...} Did it work?

      Try:

      {contentbylabel:yourlabel|...everything else...}
      

      Did it work?

  8. Feb 04, 2009

    Anonymous says:

    i am trying to create a unique space, and have a content lst for the user that i...

    i am trying to create a unique space, and have a content lst for the user that is logged-in.  Is this possible?

    I am running stand-alone evaluation, v. 2.10.

    thnx for your help!!!

    1. Feb 05, 2009

      Komathi Krishnan [Atlassian] says:

      Hi there, I believe that Pagetree macro can help doing a content list in space....

      Hi there,

      I believe that Pagetree macro can help doing a content list in space. For further detail on how to use Pagetree macro please refer to this page:

      Cheers,
      Komathi

  9. Feb 10, 2009

    Anonymous says:

    Hi, I'm using this macro as follows in Confluence Team Hosted 2.10.1: ...

    Hi,

    I'm using this macro as follows in Confluence Team Hosted 2.10.1:

    No content found for label(s) -done,+MB,+PCI,policy,process,procedure.

    It seems to work fine in that it shows pages which do not have label done plus have MB and PCI labels, and policy, process or procedure labels.

    However it also lists pages that have a text value of policy, process or procedure but no labels of the same values (and which do not have label done plus have MB and PCI labels). So it seems to be searching the whole page, not just the labels.

    Am I doing something obviously wrong here?

    Thanks,

    Melissa

    1. Feb 10, 2009

      Anonymous says:

      Macro code is {contentbylabel:label=-done,+MB,+PCI,policy,process,procedure ...

      Macro code is

      {contentbylabel:label=-done,+MB,+PCI,policy,process,procedure|showSpace=false|showLabels=false|sort=title|space=@self|max=99}

      Melissa

    2. Feb 26, 2009

      Henry Tiong [Atlassian] says:

      Hi Melissa, I noticed that you have already raised a support ticket in our supp...

      Hi Melissa,

      I noticed that you have already raised a support ticket in our support channel. We will proceed in keeping track of the progress of your issue through your support ticket.

      cheers,
      Henry CL Tiong

      1. Mar 03, 2009

        Melissa Brett says:

        Thanks Henry. I actually have a question about the documentation on this macro, ...

        Thanks Henry. I actually have a question about the documentation on this macro, which says:

        "To indicate that the results must match at least one of the specified label values, simply list the labels separated by commas. For example: If you specify a label value of -badpage,goodpage,superpage you will get content which has a label of either 'goodpage' or 'superpage' (or both) but does not have the label 'badpage'."

        I am possibly misunderstanding the meaning here, so need some clarification.

        If I have a content by label macro that specifies 'label=-ZZ,+AA,+BB,CC,DD'

        my list should show pages that don't have label ZZ, that have labels AA and BB, and also have label CC or DD (or both)?

        And further, if I have some pages with labels AA and BB, which do not have labels ZZ, CC or DD, should these show up in a content by label macro list that uses the above label specfications?

        Thanks

        1. Mar 05, 2009

          Giles Gaskell [Atlassian Technical Writer] says:

          Hello Melissa, I'm just confirming that your presumption is correct. Hence, if...

          Hello Melissa,

          I'm just confirming that your presumption is correct.

          Hence, if you had AA,+BB,+CC,DD,EE,-FF, then the parameter to which this applies:

          • must match BB AND CC
          • must match ONE OR MORE OF: AA, DD or EE
          • must NOT match FF

          Bear in mind that this principle applies to several of the parameters above: label, author, etc.

          Hope this clarifies the situation.

          Best regards,

          Giles Gaskell
          Technical Writer
          ggaskell@atlassian.com
          ATLASSIAN - http://www.atlassian.com

          1. Mar 09, 2009

            Melissa Brett says:

            Thanks Giles.

            Thanks Giles.

            1. Mar 17, 2009

              Giles Gaskell [Atlassian Technical Writer] says:

              Hello Melissa, While the information I wrote above is still true, I received so...

              Hello Melissa,

              While the information I wrote above is still true, I received some additional information about the operator parameter, which if used in conjunction with the label parameter, affects non-prefixed label values (i.e. labels without a '+' or '-' immediately preceding them). I don't know if this affects your situation, but it's worth mentioning because the behaviour is somewhat complex.

              Hence, if you had:

              labels=label1,label2,label3|operator=OR (this is the default behaviour of the operator parameter, which is the same as if it were not used in the macro at all)

              then your content must have one or more of the 'label1', 'label2' or 'label3' labels.

              If you had:

              labels=label1,label2,label3|operator=AND

              then your content must have all three 'label1', 'label2' and 'label3' labels.

              If you intend to use the label parameter with '+' or '-' signs prefixing any of its label values, then avoid using the operator parameter in the same macro to minimise confusion.

              The operator parameter is available to provide support for Confluence content which was written using older versions of the Content by Label macro, when at the time, the operator parameter was the only mechanism available to implement logical operations on a set of label values.

              The documentation above has been updated with this new information, so I hope this information helps.

              Kind regards,

              Giles Gaskell
              Technical Writer
              ggaskell@atlassian.com
              ATLASSIAN - http://www.atlassian.com

              1. Mar 18, 2009

                Melissa Brett says:

                Thanks Giles, that's good to know. Am a little confused though, as my support i...

                Thanks Giles, that's good to know.

                Am a little confused though, as my support incident about this macro was closed recently, with the finding by Atlassian support being that the default OR operator functions to show '0 or more' labels, not '1 or more'. The documentation on this page was updated to reflect '0 or more', but I noticed it's now changed back to 1 or more. And in my Confluence Team Hosted instance it's definitely working as 0 or more (which I must say is not a particularly useful function to have - 1 or more makes much more sense!!).

                I've pretty much given up on this issue, but thought I'd mention it again as a) I'm sure you guys want the doco to be accurate, and b) '0 or more' functionality is basically useless, and might warrant further investigation...?

                Thanks

  10. Feb 20, 2009

    Antoine Gehl says:

    Hi, is it possible to sort related contents by the number of tags related to the...

    Hi, is it possible to sort related contents by the number of tags related to the current content.

    Thanks.

    1. Feb 24, 2009

      Komathi Krishnan [Atlassian] says:

      Hi agehl, I am afraid that this is not possible since the above {contentbylabel...

      Hi agehl,

      I am afraid that this is not possible since the above {contentbylabel} macro and {related-labels} macro do not support any parameter to do this.
      If you are keen to have this feature in Confluence, feel free to raise an improvement request at http://jira.atlassian.com.

      I am not sure whether this will be helpful, however, there are some other macros such as popular-labels and Tagcloud Macro that you might want to try.

      Cheers,
      Komathi

  11. Mar 16, 2009

    Anonymous says:

    I am hoping to ask the user a series of questions and, based on their response, ...

    I am hoping to ask the user a series of questions and, based on their response, vary the labels that a checklist is filtered by (i.e. pass a variable into the checklist function). Is this possible?

    Thanks

    Seb

    1. Mar 30, 2009

      Arie Murdianto says:

      Hi, If you are referring to the checklist plugin. It seems that the parameter w...

      Hi,

      If you are referring to the checklist plugin. It seems that the parameter which determine the label used, does not support multiple labels. I would suggest you to direct your question to the author as I believe that they know more on the plugin than us.

  12. Apr 20, 2009

    Anonymous says:

    Hi, is it possible to not show the message "No content found for label..." if n...

    Hi,

    is it possible to not show the message "No content found for label..." if nothing was found?

    Thanks

    BK

    1. Apr 22, 2009

      Arie Murdianto says:

      Hi, You can try to edit i18n.properties for the following key macros.labelledco...

      Hi,

      You can try to edit i18n.properties for the following key macros.labelledcontent.no.content.found.for. As the file is inside confluence-advanced-macros-x.x.x.jar, you need to unjar and rejar it back again. You can refer to the following doc:

      Cheers,

    2. Dec 03

      GuL says:

      We found a workaround solution for this, as we don't want to see the "no content...

      We found a workaround solution for this, as we don't want to see the "no content found for label...", too.

      We have created a user macro, which simply get's this error message before rendering the html-code of the page and then replaces this error message string by a string defined inside the macro (possibly could be optimized by using a parameter for the new string).

      Using the macro you can output whatever you want, e.g. also an empty string.

      Here's our macro code, hope it helps.

      <script type="text/javascript">
      AJS.toInit(function ($)
      {
          $("table.tableview tbody tr td").each(function ()
          {
              if (this != null)
              {
                  var noContentText = $(this).text();
                  if (noContentText.indexOf('No content found for label(s)') == 0)
                      $(this).text('New error message or just leave empty here');
              }
          })
      });
      </script>
      

      GuL

  13. May 15, 2009

    Anonymous says:

    Hi, Can I fix some labels on a page in confluence such that only space admin or...

    Hi,

    Can I fix some labels on a page in confluence such that only space admin or some restricted group can only delete it.

    I mean i want to fix just few labels for a page at the same time allowing user to play with other label i.e. they can add/remove more labels but can't change the fixed labels.

    thanx
    Manoj

    1. Jun 02, 2009

      Zed Yap [Atlassian] says:

      Hi, As far as I know, the feature requested is not available yet. However,I fou...

      Hi,

      As far as I know, the feature requested is not available yet. However,I found a feature request which might be the closest to your requirement:

      If you are less happy about the feature request above, you might want to raise an improvement/feature request in JIRA:

      Please add your comments to the discussion, vote on it and add yourself as a watcher for future updates. Also, please bear in mind the following document on how we schedule features for inclusion in our products: Implementation of New Features and Improvements.

      Hope that helps.
      Best rgds,
      Zed

  14. Jul 17, 2009

    Lars Martinussen says:

    This post was also posted on the related content user macro page I have to cat...
    This post was also posted on the related content user macro page

    I have to categories of content in my space: topic and case. The pages are labeled "topic" and "case" respectively + labels describing the content, and are sorted in to separate page hierarchies. I want to list related topics in a page:

    h4. Related topics
    {related-content:excerpt=false|space=@self|showSpace=false|showLabels=false|max=5|type=page|sort=title|label=+topic}
    

    The problem is that the above code renders a list with all pages having the "topic" label. The "topic" is not just a requirement, as I thought it was. Is it possible to render a list of pages within one page hierachy with related labels instead, and not just within the whole space?

    1. Aug 18

      Sashidaran Jayaraman [Atlassian] says:

      Hi Lars, I hope your question has been answered in the following pages: Relat...

      Hi Lars,

      I hope your question has been answered in the following pages:

      And yes you are right about the {related-content} macro that you can only restrict the macro to search a set of spaces or all spaces.

      Hope this will help others too.

      Cheers
      JSashi

  15. Oct 15

    Anonymous says:

    Hi, I am looking at using this macro to return a list of pages with a particula...

    Hi,

    I am looking at using this macro to return a list of pages with a particular label on them. However, I would like to display the page author, the creation date and the modification date along with the page title. Is this possible? I have tried using the reporter macros, but they run too slowly for us.

    Thanks.

    1. Oct 21

      Sashidaran Jayaraman [Atlassian] says:

      Hi, I am afraid that this is not currently possible. Feel free to raise an impr...

      Hi,

      I am afraid that this is not currently possible. Feel free to raise an improvement request at http://jira.atlassian.com and describe in detail how you require this feature to work. Please add yourself as a watcher, vote for this improvement and add your own comments to this improvement request. For further details on how we include new features and improvements, you might want to read this page

      As far as I know, the reporting plugin should be able to do what you require. Perhaps, you can post the problem you are having in their issue tracker so that you can get a workaround or solution. You could also get more help in our forums and mailing lists.

      Cheers
      JSashi

  16. Nov 05

    Steve Smith says:

    Hi, I have created several "primary" pages and then a bunch of "secondary" page...

    Hi,

    I have created several "primary" pages and then a bunch of "secondary" pages.  I have taken the secondary pages and moved them to be children of the related primary pages.  I'm trying to use "space=@self" in the primary pages to display links to the children.

    This is what I'm using:

    'contentbylabel:label=pm-request|type=page|showLabels=false|showSpace=false|space=@self|sort=title'

    The problem is that for some reason that I don't understand, all of my secondary pages show up as links instead of the one single document that I've moved to be a child of the primary page.  I've turned the showspace to true and there isn't a space name... odd. 

    Can anyone please help me?

    Update: okay, I think I've figured out that all of the pages have the same "space" and that's why they're doing this... that doesn't help me solve the problem yet though.

  17. Dec 02

    Dave Duvall says:

    I'm trying to use this macro to return page with a combination of labels. &...

    I'm trying to use this macro to return page with a combination of labels.   We have been labelling our pages with a "type" (standard, procedure, etc) and a domain (network, server, database)  - I can't seem to get the macro to return all pages for example that have both a "network" and "standard" label.   I want the results to be similar to the results I see when I click on the network label and then click on the "standard" related label and the list shows all pages with both labels applied.

    I hope I made it clear.  What I get right now  from this:

    contentbylabel:labels=network,standards\|title=Network Standards\|max=5\|excerpt=true\|sort=modified
    

    Is a listing of all pages with either "network" OR "standards" label.

    Thanks,

    Dave

    1. Dec 02

      Mark Hrynczak [Atlassian] says:

      Hi Dave, Use the 'operator' parameter and set it to 'AND'. i.e. {contentbylab...

      Hi Dave,

      Use the 'operator' parameter and set it to 'AND'.

      i.e.

      {contentbylabel:labels=network,standards|title=Network Standards|max=5|excerpt=true|sort=modified|operator=AND}
      

      Cheers,
      Mark

      1. Dec 03

        GuL says:

        Another option is to add a '+' before each must-have-label. e.g. window.Synt...

        Another option is to add a '+' before each must-have-label.

        e.g.

        {contentbylabel:labels=+network,+standards|title=Network Standards|max=5|excerpt=true|sort=modified}
        

        hth
        GuL

        1. Dec 03

          Dave Duvall says:

          Thanks guys - both of those worked! Dave

          Thanks guys - both of those worked!

          Dave

  18. Jan 19

    Geert says:

    Am I the only one facing this problem? https://studio.plugins.atlassian.com/bro...
  19. Feb 01

    Anonymous says:

    I would like to categorize Wiki content based on labels that follow a certain pa...

    I would like to categorize Wiki content based on labels that follow a certain pattern, such as "foo.bar.1", "foo.bar.2", "bar.baz.1", etc.) and then create reports listing subsets of pages that match similar patters, such as "foo.*", or "*.bar.*" etc. There could be a fairly large number of such labels (dozens).

    I don't suppose it's possible to use some sort of a globbing pattern or regular expression as the name of the label in {contentbylabel:label=RE}, is there? If not, is there already a feature request for this ability or should I create one?

  20. Feb 07

    Anonymous says:

    Is there a way to get the macro to produce a number representing the number of r...

    Is there a way to get the macro to produce a number representing the number of records matching the query instead of the list of results? I'd like to be able to use the results in tables and charts. Like so:

    || Number of Pages To Fix || Number of Pages Fixed ||
    | {contentbylabel:label=needs-fixing|showCount=true|space=@self} | {contentbylabel:label=fixed|showCount=true|space=@self} |
    

    and have it rendered like so:

    Number of Pages To Fix Number of Pages Fixed
    123 456

Add Comment