Gossamer Forum
Quote Reply
Re: [Paul] Mystery Hook In reply to
Hi,

No, this won't work. The program flow is:

1. Run all PRE hooks.
2. Run main code that generates the category list page. It returns $template_name, $template_vars, $template_opts.
3. Run all POST hooks.
4. Print $template_name with $template_vars

So if you are just looking at adding a new tag and not change the functionality of the home page, you want to add a POST hook that looks like:

Code:
sub my_post_hook {
my ($tpl, $args, $opts) = @_;
$args->{mylist} = '.....';
return ($tpl, $args, $opts);
}


So you basically just added a new template tag. If you wanted to replace the functionality of the home page, you would do a PRE hook that looked like:

Code:
sub my_pre_hook {
my $do = shift;
GT::Plugins->action ( STOP ); # Don't run main code.
... # Your code here
return $template, $args, $opts;
}


And the program will print out $template with $args as options.

Let me know if this helps,

Alex
--
Gossamer Threads Inc.
Subject Author Views Date
Thread Mystery Hook Paul 4087 Mar 12, 2002, 6:30 AM
Thread Re: [RedRum] Mystery Hook
Paul 3984 Mar 12, 2002, 6:37 AM
Thread Re: [RedRum] Mystery Hook
Alex 3974 Mar 12, 2002, 9:07 AM
Post Re: [Alex] Mystery Hook
Paul 3973 Mar 12, 2002, 9:12 AM
Thread Re: [Alex] Mystery Hook
Paul 3956 Mar 12, 2002, 9:17 AM
Post Re: [Paul] Mystery Hook
Paul 3934 Mar 15, 2002, 6:16 AM
Thread Re: [Paul] Mystery Hook
Alex 3922 Mar 16, 2002, 10:46 AM
Post Re: [Alex] Mystery Hook
Paul 3914 Mar 16, 2002, 10:49 AM