Loading...
 
Development

Development


Plugin output with template

posts: 29 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: 29 Germany

Just found it by myself:

replace:

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


with:

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