{report-block}
Plugin: Reporting Plugin, from version 1.0
This plugin will display the report results in a series of blocks.
Description
The user can specify whether the plugin will separate each item with a character (e.g. a comma, a hyphen, etc.) or a completely new paragraph.
Displays the each of the items from a reporter in a block of wiki text.
A report block must contain two things:
- A reporter macro (such as content-reporter or user-reporter), which finds the list of items to report on, and
- A report-body macro, which contains the wiki code which will be executed for each item. It may also optionally include a report-empty macro, which specifies what will be displayed if no items are returned from the reporter.
Usage
Parameters
| Name |
Required |
Default |
Description |
| maxResults | | all | The maximum number of results to display. |
| name | | | Parameter description goes here. |
| separator | | none | The type of separator to display between each item. May be one of the following:
- bracket - Square brackets ('[', ']') surrounding each item.
- brace - Braces ('{', '}') surrounding each item.
- comma - A comma (',') between each item.
- paren - Parentheses ('(', ')') surrounding each item.
- pipe - A pipe ('|') between each item.
- newline - A line break after each item.
- "custom" - Any other character you wish, specified between quotes.
|
| depth | | 0 | If the item has children, the depth do display its descendents. May be 'all' for all descendents, or a whole number value above 0. (Since Reporting 1.3) |
| firstResult | | 1 | (Since 2.0.0) Specify the number of the first result to start displaying in the report. The first item has a number of 1. |
Examples
User profile cards
This example will display the user profile as a set of cards, filling the screen from left to right, wrapping where necessary.
Note: This makes use of the {float} macro from the Composition Plugin.
Keychain Injection
Output the title and excerpt of each child page. This uses injection to put data into places the report-info macro can't go, such as inside link markup or as parameters for other macros.
Recipes
See Also
Just started looking at the reporting plugin as an alternative to
Love the plugin thou - very flexable...
You should be able to do this using the content-reporter. Something like this:
{content-reporter:type=news|time=7d}I'm trying to render the space description inline, but the LINKS in the description don't render as expected. The space description contains the link [Space Purpose] for example. (I do have a page called Space Purpose in the space). Then I try on the space homepage to use this code.
{report-block} {space-reporter:space=@self} {report-body} {div:style=background-color:#EEE;border:1px dotted #AAA}*A Space Description for {report-info:space:title}* ([{report-info:space:key}|//spaces/viewspacesummary.action?key={report-info:space:key}]) [edit|//spaces/editspace.action?key={report-info:space:key}] \\ {report-info:space:description > content:body|render=wiki}{div} {report-body} {report-block}render=none gives me a page rendered as HTML (so I can't use my 'render-render' user macro to render the produced 'wiki' in the current page context)
render=wiki gives me the page as html but after being rendered in some unknown context where the links don't connect to the Space Purpose page in the current space.
I need to check to see if a particular variable is distinct within a space or series of spaces and display a warning.
If I could negate the @self keyword for the content-reporter and look for content with a variable that matches the current value on the current page, this might work.
If the maxResults option had an extra block to provide information about the additional results, that could also work.
Any suggestions? Is this possible?
You should be able to negate '@self', but matching the variable to another supplier value isn't supported at present.
I'm not quite sure what you mean with regards to the maxResults option.
A possibility would be to mix in the Replace and Render plugin and use {report-info:data:My Value} as a replacement value. Eg:
{replace-and-render} {replace-item:%variable%}{report-info:data:My Variable}{replace-item} {replace-body} {report-block} {content-reporter:scope=-@self} {text-filter:data:My Variable|include=%variable%} {content-reporter} {report-body}{report-info:content:title|link=true}{report-body} {report-block} {replace-body} {replace-and-render}That sounds feasible. Out of curiosity, what things can be negated with a minus sign?
Most things that refer to a thing (eg pages, labels, page type) can be negated, but I don't have a complete list on me. Chances are, if you can list more than one of it in a parameter, it can be negated and or required (prefix with "+"). And you can use brackets too. Eg: "+one -(two, three)" would be "require one, exclude two or three".
That approach works perfectly. Thanks again!
OK, here's something that puzzles me:
What does the "keychain injection" form of data access:
%content:excerpt > render wiki%
get me that the {report-info} or {report-on} macros don't? Isn't the above equivalent to {report-info:content:excerpt > render wiki}?
Yeah, they will do the same thing in isolation, but injection has one extra trick - you can put it into macro parameters or other wiki markup. Eg, {my-macro:param=%content:title%} or [Link to Page|%content:title%], etc.
Ah, nice! And this works all by its lonesome (as long as the Reporting plugin is installed), or does it need to be wrapped by one of the reporting macros that invokes a supplier? (I'm guessing the latter but want to confirm -- was pleasantly surprised by the ability of {report-info} to stand alone).
These are great tools.
It needs to be wrapped. The simplest way is to use the report-on macro. Just do this:
{report-on:injected=true}[Injected Link to Parent|%content:parent > content:title%]{report-on}Hi,
just writing a short documentation about the reporting-plugin and was wondering how the nested reports with the "-1" to "-5"
identifier works.
In all my tries i always get a "Item already rendered: ..." message.
even this small markup
{report-block} {local-reporter:content:children} {local-reporter} {report-body} {report-info:content:title} {report-block-1} {local-reporter:content:creator} {local-reporter} {report-body-1} {report-info:user:name} {report-body-1} {report-block-1} {report-body} {report-block}I read somewhere that the inner local-reporter has it's context set to the outer, but setting the right source with injected=true
-parameter doesn't help.
Cause there's no other help here, i'd like to know the right syntax. It's just for interest as i know other solutions for that.
regards Christian
It's probably a bug - I don't see anything wrong with your code. We added anti-recursion code into the plugin a couple of versions back to prevent infinite looping, but it may be a little too aggressive.
I've created a bug report - feel free to add comments/watch/etc.
Ok,
will watch and vote for it!