[geeklog-devel] Proposal: Plugin vars in templates

Joe Mucchiello joe at ThrowingDice.com
Sat Aug 11 23:34:28 EDT 2007


At 10:09 PM 8/11/2007, Blaine Lang wrote:
>In the case of my cart plugin, I use an autotag anyways so the 
>[cart] tag can be where the user wants it. In the case of the 
>ratings plugin specifically, why not use a [ratings] autotag which 
>the story author or forum post author can then use to add a 
>formatted ratings block at the end of the story or in the middle. 
>Not need then for a template variable.

Because autotags are not called with context. Where do I get the sid 
of the story inside a call to plugin_autotag_yourplugin? There was a 
patch for PLG_replaceTags where you could pass an array of info into it:
PLG_replaceTags($content, '', Array('type' => 'story', 'sid' => $sid));
But it hasn't been put to CVS. I think it's somewhere in the lost bug 
tracking/feature request database.

Without it, how does the ratings plugin link the rating to the current story?

With a template var, you know the template type is 'story' and you 
can call $T->get_var('sid') to get the story id.


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




More information about the geeklog-devel mailing list