How can I use {content-options} to create a page label?
Hi,
I have the following piece of scaffolding and reporting macro code in a live template:
{list-data:provider}
{content-options:parent=Add a new System}
{list-data}
...
{hidden-data}
{report-table}
{local-reporter:data}
{local-reporter}
{report-on:injected=true}_{add-label:provided_by_%data:provider%}{report-on}
{report-table}
{hidden-data}
The purpose is obviously to label each new page with the label "provided_by_system_name", where system_name is the page title of the selected system in the "provider" list-data. When I didn't get it to work (it does work with list-data that is made up of hard coded options), I tried this, just to see what %data:provider% returns:
{report-table}
{local-reporter:data}
{local-reporter}
{report-on:injected=true}%data:provider%{report-on}
{report-table}
To my utter surprise, this is what I got:
page: Integration_Platform v.2 (295131)
I realize the selection ends up as a link (which is great by the way), but the string returned by %data:provider% is not very useful when it comes to construct a string for the {add-label} macro...
What to do?
[Update]
If I stick
{report-info:data:provider}
in the same {report-table} section it dutifully renders as:
Integration_Platform
which is what I wanted in the first place. But I can't piece it together so that that string feeds the {add-labels} macro. So close, but no cigar yet...
Cheers,
/Martin
I have the following piece of scaffolding and reporting macro code in a live template:
{list-data:provider}
{content-options:parent=Add a new System}
{list-data}
...
{hidden-data}
{report-table}
{local-reporter:data}
{local-reporter}
{report-on:injected=true}_{add-label:provided_by_%data:provider%}{report-on}
{report-table}
{hidden-data}
The purpose is obviously to label each new page with the label "provided_by_system_name", where system_name is the page title of the selected system in the "provider" list-data. When I didn't get it to work (it does work with list-data that is made up of hard coded options), I tried this, just to see what %data:provider% returns:
{report-table}
{local-reporter:data}
{local-reporter}
{report-on:injected=true}%data:provider%{report-on}
{report-table}
To my utter surprise, this is what I got:
page: Integration_Platform v.2 (295131)
I realize the selection ends up as a link (which is great by the way), but the string returned by %data:provider% is not very useful when it comes to construct a string for the {add-label} macro...
What to do?
[Update]
If I stick
{report-info:data:provider}
in the same {report-table} section it dutifully renders as:
Integration_Platform
which is what I wanted in the first place. But I can't piece it together so that that string feeds the {add-labels} macro. So close, but no cigar yet...
Cheers,
/Martin
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Hi Martin,
I am not sure if you have tried chaining the suppliers yet.
Basically, when you see the output as "page: Integration_Platform v.2 (295131) ", it means the data you are reporting on is a page object and contains all of the data that relates to the page, to get the page title, you will need to add " > content:title" to the end of your injection value so instead of:
%data:provider%
you will need to put:
%data:provider > content:title% (ie. get the "title" attribute from the object)
This should give you what you are looking for.
Regards,
Bo Wang
1 person says
this answers the question
-
Inappropriate?Thanks Bo, that was it! Is there any in-depth info about the providers and how to chain them? I found the doc on it from your plug-in documentation site, but it is really hard to figure out these nifty things from that info
/Martin
I’m back on track
-
Inappropriate?Hi Martin,
Try the homepage for Suppliers ( http://www.customware.net/repository/... ), it has a list of all of the suppliers available as part of our plugins, with a brief explanation of how supplier chaining works (towards the bottom of the page).
The concept behind suppliers is that they do not return literal values, they actually return objects, if you use the object directly, it is very similar to calling the .toString() method for that object, using supplier chaining, you can access the attributes of the object.
Hope the documentation helps, let us know if it is unclear and we will try and improve it.
If you are curious on how it works behind the scenes, feel free to check out the source code from http://svn.atlassian.com/svn/public/c... and take a look around.
Regards,
Bo Wang
Loading Profile...



EMPLOYEE