Access Keys:
Skip to content (Access Key - 0)

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

  1. Install via the plugin repository, or manually.
  2. 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.

The rest should be self explanatory for anyone using this that is reasonably familiar with velocity rendering in Confluence.

Version History

Screenshots

Toggle Sidebar

Get Support

Adaptavist provide commercial support to help resolve any problems you may have using our open source Confluence plugins [Find out more...]

Need Hosting?

Adaptavist can host your Confluence wiki and open source plugins [Find out more...].

Author

Pinned Pages

  • No pinned pages.

Popular Pages

Browse


Ask questions, get help and report bugs & issues on our Community Site


View old comments

Adaptavist Theme Builder Powered by Atlassian Confluence