Hi! I'm just getting CMS set up on a couple of sites. It's great and I'm loving it.
Couple of questions:
1. I have a chunk of PHP that I wrote that displays an 'on' state for top level navigation based on the REQUEST_URI. How can I easily embed this PHP in every page of my site? I wanted to install it as a module and then call the module in the default template, but I can't find any info on how to get CMS to "see" the PHP as a module once I place the php files in the /modules/ directory.
2. Is CMS written on top of PHPSmarty? If so, does this mean I can use Smarty tags in the templates, such as Smarty's {foreach} and {if} statements?
Thanks in advance!
embedding my own php & smarty tags?
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: embedding my own php & smarty tags?
I can answer #1 for you..... create an html blob, put your php code in there (be sure to put the around it). Then put that html_blob into your template or into each page wherever you want it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: embedding my own php & smarty tags?
And I'll take #2.
Yes, it's built right on top of smarty. So all of the normal stuff will work as expected (well, not totally true. 0.10.x does some hacks with the {content}, {stylesheet} and {html_blob} tags... but otherwise it's all smarty)
Yes, it's built right on top of smarty. So all of the normal stuff will work as expected (well, not totally true. 0.10.x does some hacks with the {content}, {stylesheet} and {html_blob} tags... but otherwise it's all smarty)
-
Sererena
Re: embedding my own php & smarty tags?
I tried this with an include tag() but it doesn't actually execute it... There's basically a few files I need to have included, and normally I use an SSI include, but it doesn't seem to be working... any ideas?calguy1000 wrote: I can answer #1 for you..... create an html blob, put your php code in there (be sure to put the around it). Then put that html_blob into your template or into each page wherever you want it.
Re: embedding my own php & smarty tags?
Yeah, Pat's right. PHP code doesn't work in an html blob. Do the user defined tag as she said and it will work fine.

