1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Modifying a template using an addon

Discussion in 'XenForo Development Discussions' started by ChemicalKicks, Nov 8, 2011.

  1. ChemicalKicks

    ChemicalKicks 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.
  2. Fuhrmann

    Fuhrmann Well-Known Member

    Can you post more exactly which is the template and what is the replace you want to do?
    Morgain likes this.
  3. ChemicalKicks

    ChemicalKicks Well-Known Member

    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.
  4. ChemicalKicks

    ChemicalKicks Well-Known Member

    Hey ho was wondering if anyone could take a couple of minutes to help me with this :)

Share This Page