History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RNR-1
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Alain Moran
Reporter: Anonymous
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Confluence Extension: Replace and render

simple change could allow 'foreach' capability

Created: 08/Feb/07 07:31 PM   Updated: 22/Oct/08 01:17 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment: conf 2.2.10


 Description  « Hide
I was contemplating a simple but useful macro such as: {foreach}
{foreach-head}
|| Item || Link || Page Titles || Labelled Pages ||{foreach-head}
{foreach-tail}
{foreach-body}
|| %item% | [%item%] | {search:query=title:%item%} | {contentbylabel:%item%} |{foreach-body}
{foreach-list:%item%}
alpha
beta
gamma{foreach-list}{foreach}

that would render a table with 4 rows and the obvious replacements

But this could be a fairly simple patch to replace-and-render that includes a new tag, {replace-list} (instead of {foreach-list} )

  • Each line of the list is rendered.
  • the head / body and tail are assembled as wiki and rendered as one step
  • Not that I know a use case yet, but if you had multiple lists, it would do all permutations of replacements.
  • leading and trailing whitespace and newlines for the head and tail are ignored


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Alain Moran - 22/Oct/08 01:17 PM
Use the velocity-render macro