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

template hooks not omnipresent then?

Discussion in 'XenForo Development Discussions' started by User, May 25, 2011.

  1. User

    User Well-Known Member

    I am looking at templates.xml and I see
    <template title="forum_mark_read" version_id="1000015" version_string="1.0.0 Alpha 5">
    at line 5,746.

    It appears that the forum_mark_read template isn't part of a hook.

    My question is whether this is by design or whether it is an oversight? Should all aspects of a template be accessible via a hook? Am I confused about hooks?
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Template hooks were strategically placed within the templates themselves. You'll want to find <xen:hook>'s within the template.
  3. User

    User Well-Known Member

    That's what I mean though, there's no hook within that template nor is that template part of a hook. I don't want to post the code into the message so I just attached it.

    Overly simplified, there is no:
        <xen:hook />
    neither is there a:
    for the forum_mark_read template.

    Attached Files:

  4. Forsaken

    Forsaken Well-Known Member

    Not every template has a hook, only ones that have a real use for them (sidebar, navigation etc).
  5. User

    User Well-Known Member

    Alright, that does answer my question. As for real use, well ..., different people different needs. ;)
    I would imagine that apart from the initial tedium of getting it done there is really no downside to include a hook for every template.
  6. Brogan

    Brogan XenForo Moderator Staff Member

  7. Forsaken

    Forsaken Well-Known Member

    Real use -> widely used.

    Most developers aren't going to make something to modify the mark read template, whereas they're likely to modify sidebar/navigation with most add-ons.
  8. User

    User Well-Known Member

    Yeah I can agree to that, ideally there would be an admincp option to disable the confirmations. Actually as ajnos pointed out in the hook request thread, a hook into that template won't actually yield the desired result.
  9. Mikey

    Mikey Well-Known Member

    Why are you looking through an .xml file anyway? o_O
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    Most likely to search for <xen: hook> or something similar.

Share This Page