Modifying a template using an addon


Well-known member
I just really need a nudge in the right direction.

I'm attempting to modify a small part of a template and do so by creating an addon which I would like to share when done. I've watched some videos explaining how to insert things into a template however I'm wanting to chop a bit out and replace it with something else.

So in my mind I have two problems as it currently stands.

1. I have absolutely no idea and have seen no example code explaining how to replace code within a template.

2. The template which I wish to modify only has one hook located in it which is of no use to me, however.... I have discovered that the template that's of interest to me is seems to be grouped with another template ie it's a child of so I figure I can use the parent and somehow hook into the child.

I realise that I'm rambling and if you need any clarification please ask because I need direction :D

Thanks in advance.


Well-known member
Can you post more exactly which is the template and what is the replace you want to do?
I guess that would rather help..... :LOL:

The template is called thread_list_item, I'm wanting to replace this
<a href="{xen:link "threads{xen:if '{$thread.isNew} AND {$thread.haveReadData}', '/unread'}", $thread}"
With this
<a href="{xen:link "threads{xen:if '{$visitor.user_id}', '/unread'}", $thread}"
There only appears to be one hook within thread_list_item but it's been grouped with thread_list so I reckon I'll have to poke about in there. Correct me if I'm going down the wrong path.