Description/Features
| Security Risk The body of this macro renders velocity markup which, as the comments explain, can be exploited to get deeper access to the system. This is possible anywhere that you can place velocity and should not be offered to untrusted users. In an enclosed environment (such as a website) where you want explicit template control, then this is likely to be for you. |
An alternative to Confluence's blog posts macro to aid with customisation.
It provides a flexible news output using VTL in the macro body. A great alternative to the blog posts macro if you need to customise the output to make it better fit your design, e.g. in a blog.
Example Usage
- Install via the plugin repository, or manually.
- Use the following on a page:
{custom-news} ## Setup our search #set($newsFinder = $helper.customNewsFinder) ## Just the most recent 3 news items #set($newsFinder.maxResults = 3) ## Group by year, then month. Order reverse chrono comes in at this point. $newsFinder.groupBy("year,month") ## Get specified news #set($stories = $newsFinder.getResults($renderContext)) ## Don't bother if there's nothing there #if ($stories.items.size() > 0) <ol> #foreach ($story in $stories.items) <li><a href="$req.contextPath$generalUtil.getPageUrl($story.item)">$story.item.title</a></li> #end </ol> #end {custom-news}
Velocity Context
The following objects are available for use within the velocity context.
| Name | Object Type |
|---|---|
| $helper | com.adaptavist.customNews.CustomNewsHelper |
| $helper.newsFinder | com.adaptavist.customNews.CustomNewsFinder |
The rest should be self explanatory for anyone using this that is reasonably familiar with velocity rendering in Confluence.
Version History
Screenshots
Screenshots |
|---|
| There are no images attached to this page. |


Comments (2)
May 14, 2009
Steeve Cayla says:
Hi, The link to the doc is no longer available on atlassian website. Thanks for...Hi,
The link to the doc is no longer available on atlassian website. Thanks for updating it.
Regards,
Steeve
Nov 14, 2009
Guy Fraser says:
Does anyone still use this plugin? We're thinking of retiring it. There's now f...Does anyone still use this plugin? We're thinking of retiring it.
There's now friendly blog-archive macro and blog-list macro features in Theme Builder (which is now free) that generate HTML (nested unorderd lists, etc.) that's easy to style with CSS.