• 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?

User

Well-known member
#1
I am looking at templates.xml and I see
HTML:
<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?
 

Jeremy

Well-known member
#2
Template hooks were strategically placed within the templates themselves. You'll want to find <xen:hook>'s within the template.
 

User

Well-known member
#3
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:
Code:
<template>
    <xen:hook />
</template>
neither is there a:
Code:
<xen:hook>
    <template>
    </template>
</xen:hook>
for the forum_mark_read template.
 

Attachments

Forsaken

Well-known member
#4
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:
Code:
<template>
    <xen:hook />
</template>
neither is there a:
Code:
<xen:hook>
    <template>
    </template>
</xen:hook>
for the forum_mark_read template.
Not every template has a hook, only ones that have a real use for them (sidebar, navigation etc).
 

User

Well-known member
#5
Not every template has a hook, only ones that have a real use for them (sidebar, navigation etc).
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.
 

Forsaken

Well-known member
#7
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.
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.
 

User

Well-known member
#8
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.
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.