Loading...
 
Development

Development


Plugin output with template

posts: 32 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:

Copy to clipboard
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:

Copy to clipboard
<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: 32 Germany

Just found it by myself:

replace:

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


with:

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

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting