Gossamer Forum
Quote Reply
site_html_display hook
I'd asked alex about this before, but wonder if anythings changed.

Is there a way to override site_html_display_* so that before it does *anything* else it runs your hook?

I'm looking at a plugin from a year ago, and I had to install a hook for each template I wanted to add some tags to.

I guess it could be done in a template global, or as a <%function%> in each template, but something is nagging at me that the "correct" or "cleanest" way from a logic point of view would be to override/hook into the main display routine.

Using the globals.txt or <%function%> in each template (rather than a specific template) seems like GOTO's in BASIC. It's a way to cause more problems, in the long run, since it distributes the processing logic.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] site_html_display hook In reply to
Oh... the reason for this is that I wanted/needed to hook some major processing code into the generation of the added tags. Stuffing that sort of code into globals.txt didn't seem right, and <%functions%> means having to edit all the templates if I change the name/location of it.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] site_html_display hook In reply to
If there were a hook on Links::user_page, this would easily be possible, because everything goes through there in the end.

+1 for a hook on Links::user_page.

Ivan
-----
Iyengar Yoga Resources / GT Plugins