I have set up a Confluence instance as a documentation site and to publish announcements regarding my external application. In my external application, I want to display a feed of announcements (News) from Confluence. I used the Feed Builder to create a feed of only blog posts in the space that I am interested in. Unfortunately, the generated content for each item is in HTML, and includes additional information that I am not interested in displaying, namely the "Page added/edited by User" bit at the top.
How do I change what HTML is rendered for each entry? Is there a way to do it without modifying Confluence?
Also, I noticed in the XML of the feed, the body of each entry was in a "summary" element, with an attribute "type" set to "html". Does that mean there's a way to generate a feed which only outputs plain text? If so, why isn't it in the Feed Builder wizard?
Community moderators have prevented the ability to post new answers.
As far as I can tell from looking at the source, it's not possible to remove the "Blog post added by" header through the UI from RSS feeds.
However, a quick browse through the source shows that this content comes from a velocity template, so you should be able to hack it manually.
Disclaimer: This isn't a supported configuration, and any changes will be lost/broken on upgrade.
Assuming it's a standalone install (I used Confluence 3.5.2 because I had it handy):
1) Browse to confluence\WEB-INF\lib\confluence-3.5.2.jar
2) Extract confluence-3.5.2.jar to a temporary directory.
3) Browse to templates\rss\page-rss-content.vm
4) Hack the template as you see fit. For example, to get it to display the entire content every time, replace its content with:
#parse ("templates/rss/includes/header.vm")
$wikiStyleRenderer.convertWikiToXHtml($renderContext, $entity.content)
#parse ("templates/rss/includes/footer.vm")
5) Shut down Confluence.
6) jar up the directory again and copy it back into WEB-INF\lib (make a backup first).
7) [Optional] Say a prayer to the deity of your choice.
8) Delete the Tomcat "work" directory.
9) Start up Confluence.
No promises :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.