Page 1 of 1

entries_header/footer hook in Archives page

Posted: Thu Jul 21, 2005 2:05 pm
by wesley
I've now added a navbar on my website using that HTML nugget plug-in
I made which makes use of entries_header and entries_footer hooks.
The problem I noticed was that apparently the Archives page and the
subsequent View Topics page do not have these hooks and loading these
pages would make my navbar disappear. Could the hooks be added to
the appropriate places in s9y 0.9? Should I take a look at the trunk and
do the modifications?

Oh, and also, I'd like to have a hook that's located right after the article's
author/category/time/comments/trackbacks line, too, as noted in the plug-
ins thread.

Re: entries_header/footer hook in Archives page

Posted: Thu Jul 21, 2005 4:05 pm
by garvinhicking
Hm, I'm quite sure there must be some hooks available also on archives and other pages?

If not, maybe you can offer a patch for the templates? The problem with introducing new hooks in the templates is that they will be needed in all sorts of places like additional_themes and bundled themes. And users need to be informed to edit their own templates.

Please also look if you can output information on other places for that article's author thing. Event hook calls are not terribly expensive, but we already have lots of them on the page, so each new one does indeed impact page generation times. Especially hooks within the entries loop are very expensive.

Regards,
Garvin

Posted: Fri Jul 22, 2005 3:19 am
by wesley
There needs to be hooks in entries_archives.tpl (the whole archive
listing) and entries_summary.tpl (the summary by month). None of them
have any hooks in them. This is true even for the current SVN snapshot.

There are two ways of going about this problem as I see it.

1. Insert the hooks into the .tpl files mentioned above.
2. Devise new hooks named something like page_header & page_footer
and put them into content.tpl.

The second one is nice in that it won't interfere with other hooks, and
only needs one tpl file to be modified. However, none of the existing stuff
will take advantage of them, and these new hooks will be redundant in
the normal 'entries' page. You mentioned that less hook calls the better,
so it isn't impressive in that regard.

In the case of the first one, we're dealing with predefined hooks, so
the existing stuff can still take advantage of them, which is good... unless
they don't like seeing them in 'archives' and 'summary' page (so far the
ones I know that do use it don't seem to mind this, thankfully).

I checked with all the bundled themes. Only two themes have the said
.tpl files: the default theme and wp-compat (which doesn't seem to show
up at all in my theme list). As for the additional_themes, there is only
one theme that has them: 'truth'. I'm going to commit the changes
pertaining to the first choice in SVN / CVS for the affected themes.

EDIT: Changes have just been committed.

As for the hook-under-the-author thingy, I'll look further into it.