Templates

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

Moderator: Spunkmeyer

Templates

Postby shipmate8 » Thu May 25, 2006 1:51 pm

Background: I am trying to use a template .tmpl file to generate my html page. I have placed all the html code and coranto fields I want in the template and changed the profile to point to the tmpl. I also added the name of the html file I want Coranto to generate as well. I read the documentation on templates including the use of <Field: Content>.

My questions:

1. Is Coranto supposed to automatically generate the html page for me (place it in the htdocs directory)? If so, this is not happening--even with Full Rebuild.

2. Where, exactly, do I place <Field: Content>? Is it in the html page? In the Template? Or in the News Style?

3. Do I still need to use a include statement in the html file--or can I just add it to the bottom of the template?

Thanks much in advance
Greg
shipmate8
 
Posts: 10
Joined: Sun Oct 30, 2005 1:01 am

Postby Dale Ray » Thu May 25, 2006 4:11 pm

The following docs will help you understand the relationship between profiles, styles and templates.

How Coranto Works by Sumaleth

Coranto tutorial part 3 - Profiles, styles and templates by SrNupsen

You may want to read the rest of SrNupsen's tutorials at the Guides page on this site.

A template is simply a WRAPPER that uses a special Coranto field to include the file created by processing the profile through a style. So create what amounts to your final page (whether it is .html, .shtml, or .php) and place:

<Field: Content>

where you want the output of the profile inserted.

When news is built Coranto will process the profile through your style and the result will be substituted into the template at the spot where the <Field: Content> tag is at. The result should be a page (file) that has all of the template's contents plus the output of the style.

These are usually referred to as 'static pages' and in their simplest form that's is what they are. If you create a file called page.html that has other php code or SSI your server will simply present the contents of page.html to your users when called for.

But the file resulting from using a template can include php code, javascript, or server side includes (SSI). These will be processed by the server when the page is called and at this point Coranto has nothing to do with the process (except that you can create the information included by the server with Coranto).

1. Is Coranto supposed to automatically generate the html page for me (place it in the htdocs directory)? If so, this is not happening--even with Full Rebuild.


Yes, if it isn't check your profile settings or possibly the permissions for the destination directory (it must have write permissions, usually specified as 666). The extension of the file created is set on the main settings page under the setting headed "Archive HTML File Extension:".

2. Where, exactly, do I place <Field: Content>? Is it in the html page? In the Template? Or in the News Style?


In the template where you want the profile's output.

3. Do I still need to use a include statement in the html file--or can I just add it to the bottom of the template?


For the output of the profile that the template is set for you do not need an include statement in either the finished output or the template for the profile output to show up. You will need includes (or some other type of code) if you want the server to dynamically include OTHER content on the page when it is viewed. (headers, footers, menus, etc.)
Dale Ray
User avatar
Dale Ray
 
Posts: 1004
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby shipmate8 » Fri May 26, 2006 11:48 am

Dale--thanks much that was very helpful. I have everything working the way I want now. However, I am having one otehr problem and hope you can help me with it.

My understanding of SSI is that once there is a change to the page it shoud update automatically. In other words, when I post news (via submit routine), my shtml/html page is not automatically updating even though I have Apache set to SSI both html and shtml. It works on refresh fine.

I have been told that I can add a second line to auto execcgi but do not know what cgi to point to. Here is what I have in my tmpl file for SSI:

<include file="n2log.txt">
<exec cgi="script.cgi"> (What do I put here?)

Thanks mate!
Greg
shipmate8
 
Posts: 10
Joined: Sun Oct 30, 2005 1:01 am

Postby Dale Ray » Sat May 27, 2006 3:57 am

The following is based on my understanding of SSI - if anyone sees inaccuracies in this, speak up.

A page that uses server side includes will not automatically update when a file on server is changed. Any content that is included on the page using SSI or any CGI script that is run runs when the page is requested.

You would have to use client side javascript, dhtml, or some other scripting technique to have the users browser request the page, in effect an auto-refresh.

If there is any technique for the server to force a page to update on the user's end I don't know how to do that.
Dale Ray
User avatar
Dale Ray
 
Posts: 1004
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby shipmate8 » Sun May 28, 2006 11:02 am

Thansk Dale--appreciate all the help bro!
shipmate8
 
Posts: 10
Joined: Sun Oct 30, 2005 1:01 am


Return to Customization

Who is online

Users browsing this forum: No registered users and 1 guest

cron