[geeklog-devel] Ability to set user defined template variables

Blaine Lang geeklog at langfamily.ca
Fri Jun 4 17:33:12 EDT 2004


There are times that you want to extend a template and have access to a {variable} in the .thtml file.

I was thinking that it may be nice to have a PLG function that if existed would be called and it would be up to that function to set the template variable.

I can use PHP in header.thtml but still I'd rather just use a {variable}.
I can also replace the complete COM_siteHeader but thats a bit of overkill to just add a variable.

What if I just wanted to add a logout link or add a something to the topicsblock.

If the block functions checked for plg_setvar_blockname() then I could add a function like this:

plg_setvar_siteheader (&$template) {
    global $_USER;
    if ($_USER['uid'] > 1 ) {
         $template ->set_var( logout_link', '<a href="...">logout</a>');
   }
 );

I expect this may add some overhead and maybe we don't add to COM_showBlock but maybe add it to a few of the main block functions.

Feedback ??

Blaine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20040604/bc5699ec/attachment.html>


More information about the geeklog-devel mailing list