Gossamer Forum
Home : Products : Links 2.0 : Discussions :

How can I create a new template file that gets generated?

Quote Reply
How can I create a new template file that gets generated?
Is it somehow possible to create a new template file and have it generate and post the output to a file in the "public_html" area of my server.

What I want to do is have a small template file (such as the small menu that has the add resource, random link, etc links on it) that is generated and posted to a directory called /include on the web server.

Then in my other template files I will add SSI that includes this file.

The purpose for this is so that if I have generated content that is the same on all those pages I can just have it in one small file then include it (via SSI) on all the pages that use it. And when I need to update any of this information I can just edit the 1 file that everything else includes.

The part I can't figure out is how to do this with the generated files.

Any ideas?

Thanks much,
Moby2000
Quote Reply
Re: How can I create a new template file that gets generated? In reply to
I'd take a look at:

http://www.gossamer-threads.com/...ces/Detailed/26.html

Which will allow you to use:

<%include filename.txt%>

as a tag in your templates. Simply place the file you want to include in your templates directory, and you can use that tag above.

Hope that helps,

Alex
Quote Reply
Re: How can I create a new template file that gets generated? In reply to
An odd thing....

When I cut and pasted the text from your version Alex I kept having errors in template.pm.

When I cut and pasted the radburn original text, I had no problems.

Could be I just screwed something up or not. You might want to check it out.

It's working great now. The include feature is very powerful! Thanks!