Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Forum Module

Discuss the Forum Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Special Template for ForumHolder


4 Posts   654 Views


10 May 2011 at 6:53am Community Member, 197 Posts

I want to use a special template named "" if the get paramager ?feed=1 is passed.

For example, this should be rendered with

I tried modifying ForumHolder.php, as shown below however that does not render the data in my template.


10 May 2011 at 8:09am Forum Moderator, 474 Posts

This is usually done using actions, so would use the template file.

Getting it to consistently use for a specific get switch takes a lot more effort that most people realise. You can get it working in some cases by adding the check to an index() method, and returning $this->renderWith(''), though that won't work as soon as someone tries it on an action.


10 May 2011 at 8:26am Community Member, 197 Posts

Thanks, simon_w for your reply.

How can I do this with an action? Do you have some sample code I could use or a link to documentation?


10 May 2011 at 8:29am Forum Moderator, 474 Posts

The only thing you may need to do is add the action to the $allowed_actions array. SilverStripe looks for first when deciding which template to use.