[geeklog-devel] On to the next release

Blaine Lang devel at portalparts.com
Sun Sep 2 12:02:42 EDT 2007


Joe Mucchiello wrote:
 > There should be a call to $template->set_vars('unique_id', $id) so 
that inside plugin_templatesetvars_$plugin, you can find the id of the 
item being displayed.

I like that idea of using the template class to set a unique id variable 
which could then be used by plugins PLG_templateSetVars without needing 
to extend the API function.  The API already passes the template and 
'template_name' which developers can use $template->get_var('unique_id') 
if it needs the story SID.

In the case of rendering a story, this is already done and this example 
for lib-custom on a fresh GL install works
function CUSTOM_templateSetVars ($templatename, &$template) {
    if ($templatename == 'featuredstorytext' or $templatename == 
'storytext') {
        $sid = $template->get_var('story_id');
       // Do what we need with $sid and set our custom template vars
    }
}

Blaine
> One more feature request. How about we settle the 
> PLG_templateSetVars/PLG_itemSaved issue from January? Either change 
> the API as I described or at least add the calls to these existing 
> functions where they should be.
>
> For example only stories supports calls to PLG_templateSetVars and 
> PLG_itemSaved. Of course, missing is PLG_itemDeleted but that could be 
> covered by a 3rd parameter to PLG_itemSaved. Users, groups and 
> comments have custom functions that do the same thing (mostly). I've 
> added calls to setvars and itemsaved to calendar (and I've got a file 
> of altered functions that i'm using to bridge between 1.4.1 and the 
> 1.5 changes to stuff like ADMIN_list.) How hard would it be to do the 
> same thing in polls and links and whereever else they should be? Calls 
> to PLG_templateSetVars should be just about everywhere there's a major 
> call to parse.
>
> One more thing. There should be a call to 
> Template->set_vars('unique_id', $id) so that inside 
> plugin_templatesetvars_$plugin, you can find the id of the item being 
> displayed. Doing so probably also helps with theming.
>
> ----
> 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
>
>



More information about the geeklog-devel mailing list