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

Plugin development problems & questions

Quote Reply
Plugin development problems & questions
1) I would like to create a plugin, which will include (insert) a left side menu into the category, home, new, etc. templates (<%menu_left%>).

Where to hook this menu, to be able to use its tag in all category, home, new, etc. templates?

2) Other.
I'm a bit confused about how plugins works, because strange things happens sometimes.
I know how the plugins logically works... There is described on page /GT/Plugins.html in 4 points.
But sometimes I don't find logical answers why a part of a plugin is not working...
I think there are not enough plugin examples & enough detailed plugin how-to-s & descriptions.
There should be more & more detailed Module descriptions, Plugin How-To-s, Plugin Hook descriptions, and Developers Guide...

Let me show you, how the example plugin (which is not working currently) looks.

The plugin.cfg file has the hook:
Code:
'LinkPlugin' => {
'hooks' => [
[
'site_html_category',
'PRE',
'Plugins::LinkPlugin::site_html_category',
'1'
]
....

The LinkPlugin.pm file has the sub site_html_category, and has a code:
Code:
sub site_html_category {
my ($args) = shift;
print "Content-Type: text/html\n\n";
print "cccccccccc test text";
$args->{'menu_left'} = "aaaaaaaaa";
return $args;

But nothing is displayed.
What is wrong?
Is there any other place, where installing a plugin modifies something? If not, then why is not working this example plugin?

Any idea?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Feb 23, 2002, 11:04 AM
Quote Reply
Re: [webmaster33] Plugin development problems & questions In reply to
You shouldn't be using a plugin for that. A simple global is all that is needed.
Quote Reply
Re: [RedRum] Plugin development problems & questions In reply to
Hmmm. Good idea.
Yes, this is the point where the usage of globals is reasonable. Cool
Thanks for the advice!

But how about the problems I mentioned in 2nd point of my original post?
The problems will be come out again next time... Unsure

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Plugin development problems & questions In reply to
Hi,

One thing to try is to set debug level to 1 and look at the error logs. You should see a list of the plugin hooks being run.

An easy mistake that can be hard to debug is to misspell a hook name. Let me know how it turns out.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Plugin development problems & questions In reply to
Yeah :)

That, and several others that don't cause the program to stop, but cause your plug in not to run :)

debug, error logs, and experience :)


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.