coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: steveeh131047 on March 17, 2008, 01:02:42 PM

Title: [Solved]: Embedded call to PHP from template
Post by: steveeh131047 on March 17, 2008, 01:02:42 PM
Hi,

I just upgraded to 1.14.6 and was reminded what a superb, flexible script, Coppermine is.

I'm now trying to integrate it better into the "look and feel" of a web site with some significant changes to the theme files. Everything works well, except that if I include a call in the theme.html template file for some PHP to generate content dynamically (e.g. <? require("../naviagation_links.php"); ?>) it seems to get ingored.

I don't think it's a path issue because I've tried many different combinations. I also have the right .htaccess entries to allow a .html file to be parsed for php.

Am I missing something? Perhaps I can't include a php call within a template?

Steve


Title: Re: Embedded call to PHP from template
Post by: Nibbler on March 17, 2008, 01:05:31 PM
Exactly, you can't. This is explained in the documentation. Use the custom header/footer features instead.

Quote from: Steveeh on March 17, 2008, 01:02:42 PM
I also have the right .htaccess entries to allow a .html file to be parsed for php.

Apache never sees template.html - it's handled within Coppermine.
Title: Re: Embedded call to PHP from template
Post by: steveeh131047 on March 17, 2008, 01:17:51 PM
Nibbler,

Thanks for that. I'll look for another way to generate the content. Even if I can't, I can get pretty close to the appearance I want just by modifying style.css and theme.php.

Thanks for your help.

Steve
Title: Re: Embedded call to PHP from template
Post by: Nibbler on March 17, 2008, 01:25:15 PM
Use the custom header feature. Put {CUSTOM_HEADER} where your require() is and enter the path to the file in config as the custom header path.
Title: Re: Embedded call to PHP from template
Post by: steveeh131047 on March 17, 2008, 02:04:51 PM
Nibbler,

Great - just tried it and it works beautifully.

Thanks,
Steve