Over Complicating Thread List Template Change?

Snog

Well-known member
I'm working on a mod that requires the thread_list_item template to be changed in a specific forum.

The only way I can think of to accomplish this, is by extending the XenForo_ControllerPublic_Forum class, checking forumId in my class and then switching the whole forum_view template to a new template.

This works fine, but it seems as though that's over complicating what should be a simple process of just changing the thread_list_item template.

Does anyone have any suggestions or ideas?
 
Give me an example snippet of what you want changed in the thread_list_item template and I will test something out for you really quick.
 
It's nothing spectacular...

The avatar image changes to an image that will be contained in the thread table.

And items are added to the secondRow div in the template. Those items will also be contained in the thread table.

I would think there should be a way to simply say if the template is thread_list_item then switch to template thread_list_item_two but for the life of me I can't find it. ;)
 
Use Conditionals the check if you are in your specific node, and if it is, use xen:include and include your new template.
 
Use Conditionals the check if you are in your specific node, and if it is, use xen:include and include your new template.
If you're saying to edit the thread_list_item template. In my opinion that's not a good idea. It makes core system upgrades more difficult.
 
As you're creating an add-on, use the TM system in 1.2 to modify the template.

Again though, anyone wanting to install it will need to be running 1.2.
 
The Template Modifications System works perfectly in 1.2. I like it. :D

I just wish there was a simple way to switch templates in earlier versions without editing the template.
 
LOL, talk about over complicating.

I can do what I want with a single listener. There's no need to extend the controller class.
 
Top Bottom