[geeklog-devel] Proposal: Plugin vars in templates

Joe Mucchiello joe at ThrowingDice.com
Sat Aug 11 14:54:37 EDT 2007

This is a simple suggestion. The professional theme should be 
modified to add the following to just about every thtml file:

The location would be "at the end" but before any form buttons.

Why? So plugins like the ratings plugin would work across version 
upgrades without necessitating that the user go in an modify their 
thtml files over and over again.

In the plugin's config file would be a placeholder option: 
$_PLG_CONF['placeholder'] = 'plg3'; The user would be responsible for 
making sure each plugin requiring the placeholder service had a 
unique placeholder. Now when the template wanted to add itself to an 
existing page it would use $T->set_var($_PLG_CONF['placeholder'], 
$mycontent); to do so. As long as the user ensures the placeholders 
are unique, nothing stomps all over something else.

About the only other change probably needed would be to add the 
following to the Template class' constructor.

for ($i = 1 to 5) { set_var("plg$i", ''); }

I'm sure folks using stuff like the Ratings plugin would find this helpful.

Joe Mucchiello
Throwing Dice Games

More information about the geeklog-devel mailing list