Page 1 of 1

embedding my own php & smarty tags?

Posted: Wed Nov 23, 2005 10:16 pm
by elly
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!

Re: embedding my own php & smarty tags?

Posted: Thu Nov 24, 2005 12:47 am
by calguy1000
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?

Posted: Thu Nov 24, 2005 2:15 am
by Ted
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)

Re: embedding my own php & smarty tags?

Posted: Thu Nov 24, 2005 5:48 am
by Sererena
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.
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?

Re: embedding my own php & smarty tags?

Posted: Thu Nov 24, 2005 1:04 pm
by Ted
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.