How do I modify velocity templates for blog posts?

justindowning
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2011

I want to change the way this file appears: /pages/viewrecentblogposts.action?key=SPACE

Is there a vm/vmd file in /confluence/decorators that governs this page? What is the best way to go about this?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Stefan Kohler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2011

No, there is not really a decorator that the viewrecentblogposts.action uses, besides the root decorator.

What you could do is overwrite the action with a plugin and use your own velocity template instead of the one of Confluence

<xwork name="Custom View Recent Blog Posts" key="custom-blogpostactions">
<package name="pages" extends="default" namespace="/pages">
<default-interceptor-ref name="validatingStack"/>
<action name="viewrecentblogposts" class="com.atlassian.confluence.pages.actions.RecentBlogPostsAction">
<result name="error" type="velocity">/custom/viewrecentblogposts.vm</result>
<result name="success" type="velocity">/custom/viewrecentblogposts.vm</result>
</action>
</package>
</xwork

justindowning
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2011

Perfect! I had to modify it slightly however:

<xwork name="Custom View Recent Blog Posts" key="custom-blogpostactions"> <package name="pages" extends="default" namespace="/pages"> <default-interceptor-ref name="validatingStack"/> <action name="viewrecentblogposts" class="com.atlassian.confluence.pages.actions.RecentBlogPostsAction"> <result name="error" type="velocity">/custom/viewrecentblogposts.vm</result> <result name="success" type="velocity">/custom/viewrecentblogposts.vm</result> </action> </package> </xwork>

Stefan Kohler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2011

@justin, it was a bad copy/paste example. Good thing your worked it out. I updated the answer :)

Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 2, 2011

Besides needing a code formatting block in the editor, the lack of formatting options evidenced by this comment made me want open this improvement: https://jira.atlassian.com/browse/ANSWERS-92

TAGS
AUG Leaders

Atlassian Community Events