Loading...
 
Skip to main content

Development


PHP code in wiki pages

Hi,

I'm using tikiwiki for the first time and trying to develop a small application with it.
I'm using html and javascript on some wikipages. I use also trackers and sql commands ( via plugin SQL). I tested also successfully modules with smaty.

Everithing is running OK, except that I could not yet find a way to have some PHP code (or smarty) in wiki pages. My objective is to have the application I/O in the central wiki page and not in lateral menus solutions like modules.

Can somebody help me?

Thanks in advance,
Venap

>
> Can somebody help me?
>

You can include PHP code in a Smarty template (TPL file) by using {php}...{/php}. See the Smarty manualQuestion for additional information.

If you want the code to appear in all wiki pages, you'll need to add it to tiki-show_page.tpl.

HTH,

-Rick
Now Available: TikiWiki for Dummies SmartiesQuestion — A beginner's guide to using ))TikiWiki((.


Hi Rick,

Thanks.

If I understood, I have to include my php code, between {php}...{/php}, in a Smarty TPL file. OK, but,
1 - how can I call that TPL file from my Wiki page ( not a module )?
2 - How can I execute it?
3 - I thought that Smarty TPL files have the presentation component of the application and are referenced from php files. Is this correct?

I'm a little confused. Can you help?

> Thanks very much,
> Venap

> Hi Rick,
>
> Thanks.
>
> If I understood, I have to include my php code, between {php}...{/php}, in a Smarty TPL file. OK, but,
> 1 - how can I call that TPL file from my Wiki page ( not a module )?
> 2 - How can I execute it?
> 3 - I thought that Smarty TPL files have the presentation component of the application and are referenced from php files. Is this correct?
>
> I'm a little confused. Can you help?
>
> > Thanks very much,
> > Venap


I might be the one who is confused.... you're trying to execute some PHP on specific wiki pages, right? Not all wiki pages or all Tiki pages, right?

I suggest creating a wiki plugin (see the docs for detailsQuestion). You can include your PHP code in the plugin, then call the plugin from a wiki page:



HTH,

-Rick
Now Available: TikiWiki for Dummies SmartiesQuestion — A beginner's guide to using ))TikiWiki((.


Hi Rick,

Perfect.
Thanks very much,
Venap