PHP includes and .tmpl

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

PHP includes and .tmpl

Postby Spunkmeyer » Tue Mar 20, 2007 6:51 pm

Unless I'm mistaken, Coranto can only use .tmpl extentions for templates. If this is indeed the case, does a browser only parse them in HTML, or can you use PHP includes/SSI includes?

The reason I ask is because I want to use some PHP in my top navigational menu that basically greys out links depending on what hyperlink you click in the menu. Something along the lines of

Code: Select all

if ($pagename == 'archives') {

   print  '<div id="topMenu">&nbsp;&nbsp; | <a href="">Front Page</a> | Archives | <a          href="">Photos</a> | <a href="">About Me</a> | <a href="" >Blog</a> | <a href="">Links</a> | </div>';

else {
   print '<div id="topMenu">&nbsp;&nbsp; | <a href="">Front Page</a> | <a href="">Archives</a> | Photos | <a href="">About Me</a> | <a href="" >Blog</a> | <a href="">Links</a> | </div>';

(by the by, the above code basically says that when the archives link is clicked, PHP prints the archive version of the nav menu (the nav link is taken out on the nav page), otherwise it includes the default nav menu. Essentially at the moment, i have one of these statements for each link in my navigational menu - does anyone know how i would make this more effecient?

Anyways, back on topic...everything on the site runs through PHP, and each page is actually constructed of a few other html/php pages that in turn house page specific content (as to only edit one page and have it update all the pages). So I would like to use PHP includes in the template pages as well if its possible - anyone know how I could attain this?
"God Bless the Portable Grassy Knoll"
Posts: 69
Joined: Wed Jan 10, 2007 4:36 pm
Location: Whistler, BC, Canada

Postby Dale Ray » Wed Mar 21, 2007 6:01 am

Templates are used by Coranto to create static pages. Those static pages can contain anything your server allows in a hand coded page. Whatever web technology that you want to use can be included. Each news item is processed through the profile style and then the content created is inserted into the template in place of the <Field: Content> tag.

You can change the extension of the files using the Archive HTML File Extension setting on the main settings page, or if you want to control the extension on a per profile basis and are using Coranto 1.25 or earlier you can use the Post–Build File Renamer/Mover addon.

Any static pages created by Coranto are sent to the user by your server and will follow the rules (configuration) of that server. On most servers .shtml pages will be processed for server side includes and .php pages will be treated as php code. Coranto has nothing to do with processing the php, SSI, or javascript you include in these pages.
Dale Ray
User avatar
Dale Ray
Posts: 1004
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests