Loading...
 
Development

Development


Plugin output with template

posts: 4 Germany

Hi there,

I want to create my first plugin. It should output some simply stuff on the page.

I have a wikiplugin_bob.php:

function wikiplugin_bob($data, $params) 
{
    $smarty = TikiLib::lib('smarty');
  
    $smarty->assign('data', '<h1>hello there</h1>');
    $smarty->display('wiki-plugins/wikiplugin_bob_config.tpl');
  
}


and the wikiplugin_bob_config.tpl:

<h1>Bob Configuration</h1>

<h2>{$data}</h2>


The renderd page is:
First output (top of the page) is my bob_config.tpl
Then comes the normal page.

What I want it to do:
My own tpl should be within the normal page, the place, where i put the {bob} plugin.

Can you give me some help, please?

Bob

posts: 4 Germany

Just found it by myself:

replace:

$smarty->display('wiki-plugins/wikiplugin_bob_config.tpl');


with:

$smarty->fetch('wiki-plugins/wikiplugin_bob_config.tpl');

Upcoming Events

No records to display

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.