[geeklog-devel] PLG_itemDisplay?

Joe Mucchiello joe at ThrowingDice.com
Tue Oct 9 23:50:07 EDT 2007


At 11:34 PM 10/9/2007, Blaine Lang wrote:
>Oliver Spiesshofer wrote:
>>Step1:
>>So you would check the data in the array and eventually change it 
>>and assign the template variable again with the updated data?
>I am also not convinced that it is necessary to expand the API with 
>a $data array. If a plugin or custom function really needs to lookup 
>some data then adding a DB calls to get this information based on 
>the available keys (in existing template vars) if that data is not 
>already in the existing template vars is not really going to add any 
>noticeable overhead.

Why do you object making more data made available to the plugin? Why 
should the plugin writer have to guess? Go look at 
calendar/event.php. It never puts the eid into the template (until I 
finish the bounty). So in order to extend an event template you 
either modify event.php or fish the eid out of the URL variable. Why 
have the code do all that parsing when the array of data for the 
event is already in memory? Just pass it along to the plugins. The 
overhead to pass an extra variable (a user space memory operation 
inside PHP) is infinitely small compared to a socket send/recv 
(involving two kernel traps) to do a DB lookup. And adding the extra 
variables is mostly transparent to existing code.

>Joe Mucchiello wrote:
> > Add an extra variable to any templates expressly for the use of 
> unknown plugins: {extensions}
>
>Sounds like a lot of template changes and personally I really have 
>not been limited except on major custom site projects and well that 
>would have been the least of my worries. I would prefer not to make 
>it even more difficult for themers and site admin's to upgrade their 
>site. I'm not against it - just not convinced there is a need that 
>can not be solved today or in the few cases, require a minor and 
>easy theme update by the site admin.

Again, it's only a template change if the template is passed to 
PLG_templateSetVars. If you don't call it, you don't change the 
template. Minor theme updates are only good on pro websites with one 
theme. What about the site that allows multiple themes?

>I completed a recent project that used a number of custom autotags 
>to set new template vars and I personally prefer to add named 
>template vars as I need them. And if need, any user could easily do as well.

In custom code, this isn't an issue. The customer isn't going to go 
modifying your theme files afterward. But for public Geeklog, the 
number of customers is unknown and you can bet they will be customizing it.

----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list