[geeklog-devel] Proposal: Plugin vars in templates
Blaine Lang
devel at portalparts.com
Sat Aug 11 21:09:05 EDT 2007
I don't see the need to add these generic template vars to all of our
templates because there would likely just be confusion and collision
when the ratings plugin uses {plg1} and myplugin uses {plg1}. A generic
name is just confusing as to what is' being used for.
The plugin API PLG_templateSetVars has been an excellent addition to GL
and very flexible - granted you need to update a template to add the
variable if it does not exist but it's not hard to distribute those
updates or directions. If you don't have a plugin and want to use this
feature which has been the case for me on a few projects, adding your
code to CUSTOM_templateSetVars is straight forward and you can test for
the template file you need to to set the new variables for.
There just may be a few more places we want to add PLG_templateSetVars();
Blaine
Oliver Spiesshofer wrote:
> We should urgently take up the discussion again about the plugin
> vars... that has been sleeping for 6 month now or so...
>
> Oliver
>
> Joe Mucchiello wrote:
>> This is a simple suggestion. The professional theme should be
>> modified to add the following to just about every thtml file:
>> {plg1}{plg2}{plg3}{plg4}{plg5}
>>
>> 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
>> http://www.throwingdice.com
>> _______________________________________________
>> geeklog-devel mailing list
>> geeklog-devel at lists.geeklog.net
>> http://eight.pairlist.net/mailman/listinfo/geeklog-devel
>>
>>
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://eight.pairlist.net/mailman/listinfo/geeklog-devel
>
>
More information about the geeklog-devel
mailing list