Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: Adding a new template for modify

Quote Reply
Re: Adding a new template for modify In reply to
Hi,

The STOP only stops the user_modify_link to happen. After that, the program will display either the success or error page. If you want to display a different template, you need to override one of those pages.

You could do this:

Code:
sub plg_user_modify_link {
my $results = shift;
..
GT::Plugins->action ( STOP );
return $results;
}
and then:

Code:
sub plg_site_html_modify_success {
my $tags = shift;
GT::Plugins->action ( STOP );
return Links::load_template ('new_template.html', $tags);
}
So the first one overrides the modify code, and the second one overrides the success page with your page.

You could make it conditional by doing something like:

Code:
sub plg_user_modify_link {
my $tags = shift;
if ( .. ) {
GT::Plugins->action ( STOP );
$tags->{override} = 1;
return $tags;
}
return $tags;
}

sub plg_site_html_modify_success {
my $tags = shift;
if ($tags->{override}) {
GT::Plugins->action ( STOP );
return Links::load_template ('new_template.html', $tags);
}
return $tags;
}
So you set $tags->{override} = 1 if you want to print a new template. Then your pre hook for modify_success checks to see if override was set, if so it aborts the regular template and prints out what you want.

Does this make sense, and help you do what you want?

Cheers,

Alex

--
Gossamer Threads Inc.
Subject Author Views Date
Thread Adding a new template for modify masamoda 4245 Feb 19, 2001, 6:00 PM
Thread Re: Adding a new template for modify
Paul 4167 Feb 19, 2001, 6:28 PM
Thread Re: Adding a new template for modify
masamoda 4157 Feb 19, 2001, 6:40 PM
Post Re: Adding a new template for modify
Paul 4154 Feb 19, 2001, 6:44 PM
Thread Re: Adding a new template for modify
Alex 4157 Feb 19, 2001, 7:14 PM
Post Re: Adding a new template for modify
masamoda 4154 Feb 19, 2001, 7:24 PM