(Confluence 5.7)
Trying to write the following user macro (not a plugin- just from the user interface):
The body of the macro expects a list of link to other pages, and the macro should just apply bullet formatting on them.
The body html, may look like:
<p>
<ac:link>
<ri:page ri:content-title="Management review"/>
</ac:link>
</p>
<p>
<ac:link>
<ri:page ri:content-title="Documents control for HistoScanning, including DMR, DHR, DHF and TF"/>
</ac:link>
</p>
I digged and experimented with the macro, but could not figure out the right strategy. Any hints or examples are welcome.
Community moderators have prevented the ability to post new answers.
I would do something like this ...
## @noparams #set( $id = $action.dateFormatter.calendar.timeInMillis ) <div id="links$id">$body</div> <style type="text/css"> #links$id {list-style-type: disc; margin-top: 10px 0 0 0; padding: 0 0 0 40px;} #links$id p {display: list-item; margin: 0; padding 0;} </style>
Wow, I can confirm it does work! Thanks Davin. I would have never thought about such a solution. Now- I want to do even something more advanced. I want to put next to each page link, a certain metadata value from that page, something like this: <p> <ac:structured-macro ac:name="metadata-from"> <ac:parameter ac:name="1">Document number</ac:parameter> <ac:parameter ac:name="0">Management review</ac:parameter> </ac:structured-macro> <ac:link> <ri:page ri:content-title="Management review"/> </ac:link> </p> So actually- make a simple link into a more sophitsticated metadata+title combination?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi R Nir,
This will work. if the pages are in the same space. the body must be a comma-separate list of titles
## @noparams #set($list = $body.split(',')) #foreach($link in $list) <p> <ac:link> <ri:page ri:content-title="$link"/> </ac:link> </p> #end
Regards
Nelson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thankyou for the quick response, it does the work. . Is there a way to achieve the same if the body is not a comma seperated list but the above structured html?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.