spidersilk
01-30-2006, 06:34 AM
I've been trying to customize the templates on my directory to match the rest of my site, and I'm starting to think it's completely hopeless.
First it choked on the Javascript, but I searched through the forums and found the {literal} tag and that seemed to work. Or at least, stopped it from throwing errors - I have no idea if the Javascript is actually executing, because I can't get it to load my menus.
My pages are framed by two PHP include files, page_start.php and page_end.php. And smarty templates apparently choke horribly on PHP, despite being designed to work in PHP, which is a paradox that makes my brain hurt.
I did find somewhere where someone else had asked about this, and was told a smarty tag you could use to include a PHP file, but also given ominous warnings about how this could break the script. And I don't think that tag would work for me anyway, since the page_start.php include calls several other includes, in order to generate menus, a breadcrumb trail, etc.
IS there any reasonable way to get PHP to work in the templates? What, exactly, in a PHP file would break the script? Mine looks at where the page it's on is (via the $_SERVER['PHP_SELF'] variable) and generates the appropriate menus and breadcrumb trail accordingly. It probably doesn't need the breadcrumb trail within the directory, but it would be nice to be able to have some control over the menus.
Also, in the page_end.php include, it uses get_last_mod to generate a last modified date for the page. Again, probably not terribly relevant for the directory, and I could suppress it within this section with an if statement, but that would still require being able to execute PHP code...
Lynna
First it choked on the Javascript, but I searched through the forums and found the {literal} tag and that seemed to work. Or at least, stopped it from throwing errors - I have no idea if the Javascript is actually executing, because I can't get it to load my menus.
My pages are framed by two PHP include files, page_start.php and page_end.php. And smarty templates apparently choke horribly on PHP, despite being designed to work in PHP, which is a paradox that makes my brain hurt.
I did find somewhere where someone else had asked about this, and was told a smarty tag you could use to include a PHP file, but also given ominous warnings about how this could break the script. And I don't think that tag would work for me anyway, since the page_start.php include calls several other includes, in order to generate menus, a breadcrumb trail, etc.
IS there any reasonable way to get PHP to work in the templates? What, exactly, in a PHP file would break the script? Mine looks at where the page it's on is (via the $_SERVER['PHP_SELF'] variable) and generates the appropriate menus and breadcrumb trail accordingly. It probably doesn't need the breadcrumb trail within the directory, but it would be nice to be able to have some control over the menus.
Also, in the page_end.php include, it uses get_last_mod to generate a last modified date for the page. Again, probably not terribly relevant for the directory, and I could suppress it within this section with an if statement, but that would still require being able to execute PHP code...
Lynna