Dashboard > Atlassian Plugins > ... > Macros > content-filter
  Atlassian Plugins Log In | Sign Up   View a printable version of the current page.  
  content-filter

Added by david , last edited by David Peterson on Jan 17, 2008  (view change)
Labels: 

{content-filter}

Plugin: Reporting Plugin, from version 1.0

This filter will ensure that the specified 'prefix:key' value matches the required Confluence content value.

Description

This macro must be used within a reporter macro. It will check if the specified key chain value matches the criteria, such as its space, type, scope or labels. These options are very similiar to those provided by the content-reporter, but can be used in other contexts.

Usage

{content-filter:prefix:key|space=[space keys]|types=[types]|scope=[page scopes]|labels=[labels]}

Parameters

Name Required Default Description
[default]/key
The key value to filter on. May be '@self' to filter on the current report item.
space(s)
@self
The list of spaces to search in. Each space may be prefixed by either '+' (to indicate the space is required) or '-' (to indicate the space must be excluded). May be one of the following:
  • @self - (default) The space the current content is in.
  • @personal - Personal spaces only.
  • @global - Global spaces, that is, non-personal spaces.
  • @all - All spaces, both global and personal.
  • SPACE KEY - Any other space key may be specified explicitly.
type(s)
all
The list of content types to allow. Each type may be prefixed by either a '+' (to indicate it is require) or '-' (to indicate it must be excluded). May be any of the following:
  • page
  • news
  • comment
  • attachment
  • spacedescription
scope
List of pages, news items, etc. which are in scope. If the content is a page, the scope can be expanded to their children, descendents or ancestors:
  • > children - The direct children of the specified page. E.g. 'scope=My Page > children'
  • > descendents - All descendents of the specified page. E.g. 'scope="My Page" > descendents'
  • > ancestors - All ancestors of the specified page. E.g. 'scope=My Page > ancestors'
label(s)
List of label checks. E.g. "one, +two, -three" would list content which had the "two" label but not the "three" label.
matchAll
true
If set to 'false', content matching any of the criteria will be matched.

Examples

Display all children with the 'foo' label

{report-list}
  {local-reporter:content:children}
    {text-sort:content:title}
    {content-filter:@self|labels=+foo}
  {local-reporter}

  {report-body}{report-info:content:title|link=true}{report-body}

{report-list}

See Also

I am having problems filtering content based on a list-data. In my pages I have:

{table-data:Learnings}
|| Learnings ||
| {list-data:KompetenzMethodeType}
{content-options:spaces=Toolkit|labels=template-kompetenz,template-methode}
{list-data} \\ {text-data:Notes|type=area|width=400px|height=150px}{text-data} |
{table-data}

This works as expected. I can write text notes and select page names , e.g. Kompetenz Arbeit next to them. In my example, I have several Notes with different page names in one table.

Now, I would like to collect all entries whith the same selected page name. I use:

{report-table}
{content-reporter:space=@global|type=page|label=+projekttagebuch}
 {collection-filter:data:Learnings|matchItems=any}
     {text-filter:map:KompetenzMethodeType > reference:value > content:title|include=Kompetenz Arbeit}
 {collection-filter}
{content-reporter}
{report-column:title=Projekt}{report-info:content:space}{report-column}
{report-column:title=Notes}{report-on:data:Learnings}{report-info:Notes}{report-on}{report-column}
{report-table}

This reports only pages which contain rows with the wanted name "Kompetenz Arbeit" (es expected) but displays all rows instead of only the rows with the name "Kompetenz Arbeit". How can this be achieved?
Thanks very much for your help!

Lukas

I think what you want here is expand-on. Eg:

{report-table}
{content-reporter:space=@global|type=page|label=+projekttagebuch}
 {expand-on:data:Learnings|as=Learning}
     {text-filter:map:KompetenzMethodeType > reference:value > content:title|include=Kompetenz Arbeit}
 {expand-on}
{content-reporter}
{report-column:title=Projekt}{report-info:expanded:item > content:space}{report-column}
{report-column:title=Notes}{report-on:expanded:Learning > data:Notes|render=wiki}{report-column}
{report-table}

If you want to get a little fancier, put {repeat-filter:expanded:item} in front of the 'Projekt' column to have the project name only output when it changes.

Thanks for your SUPER-FAST reply! You and your plugin really rock!

Unfortunately, this does not solve my problem - Now, only the column Project contains data. The column Notes is empty...

Hmm. Not sure why that would be. Did you copy it verbatim? Perhaps try 'map:Notes' instead, and check that the 'as=Learning' name is equal to the 'expanded:Learning' value, including case.

Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators