Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [ridesworld] [Suggestion] Template path change for file includes

Quote Reply
Re: [ridesworld] [Suggestion] Template path change for file includes In reply to
The problem is, that this path is relative to the current template set, even if you can step out from current template root dir with <%include ../includes/header.txt%>.

But you can not use absolute path. That means you can not use the same templates for all services on your site.

You have the following site directory structure:
/cgi-bin/mysite/gforum/
/cgi-bin/mysite/gforum/admin/
/cgi-bin/mysite/gforum/admin/templates/default
/cgi-bin/lsql/
/cgi-bin/lsql/admin/
/cgi-bin/lsql/admin/templates/default
/cgi-bin/myscript/
/cgi-bin/common-templates/

Now, you could use the following tags in category.html template of LSQL:
Code:
<%include /cgi-bin/common-templates/header.txt%> # uses absolute path to include
header from central template directory.

<%include body.txt%> # uses the usual relative path to include the body part from
the current template root directory (/cgi-bin/lsql/admin/templates/default/).

<%include /cgi-bin/common-templates/footer.txt%> # uses absolute path to include
footer from central template directory.


You could use same common template files in forum-view.html template of GForum, too:
Code:
<%include /cgi-bin/common-templates/header.txt%> # uses absolute path to include
header from central template directory.

<%include body.txt%> # uses the usual relative path to include body part from
current template root directory (/cgi-bin/mysite/gforum/admin/templates/default/)

<%include /cgi-bin/common-templates/footer.txt%> # uses absolute path to include
footer from central template directory.


We could use same common templates in our own scripts mytemplate.html template of myscript.cgi, too:
Code:
<%include /cgi-bin/common-templates/header.txt%> # uses absolute path to include
header from central template directory.

<%include mybody.txt%> # uses the usual relative path to include the body part
from the current template root directory (/cgi-bin/myscript/templates/).

<%include /cgi-bin/common-templates/footer.txt%> # uses absolute path to include
footer from central template directory.


If the suggested modification would be done in GT::Template, we could use same common templates sitewide and GT::Template module in our own scripts.
Imagine: we could use the same common templates on the whole site, just from same central template directory.

Therefore, I think this would be very important modification of GT::Template module.

Ridesworld, your solution <%include ../includes/header.txt%> could be still used in your templates, but others like me, could be get more out from the GT::Template possibilities.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: May 8, 2002, 3:32 AM
Subject Author Views Date
Thread [Suggestion] Template path change for file includes webmaster33 3786 Apr 29, 2002, 11:46 AM
Thread Re: [webmaster33] [Suggestion] Template path change for file includes
webmaster33 3670 May 7, 2002, 2:08 AM
Thread Re: [webmaster33] [Suggestion] Template path change for file includes
ridesworld 3616 May 7, 2002, 1:42 PM
Post Re: [ridesworld] [Suggestion] Template path change for file includes
Paul 3622 May 7, 2002, 1:47 PM
Thread Re: [ridesworld] [Suggestion] Template path change for file includes
webmaster33 3617 May 8, 2002, 3:25 AM
Thread Re: [webmaster33] [Suggestion] Template path change for file includes
Paul 3597 May 8, 2002, 3:34 AM
Thread Re: [Paul] [Suggestion] Template path change for file includes
webmaster33 3626 May 8, 2002, 4:03 AM
Thread Re: [webmaster33] [Suggestion] Template path change for file includes
webmaster33 3582 May 14, 2002, 2:22 AM
Post Re: [webmaster33] [Suggestion] Template path change for file includes
webmaster33 3550 May 27, 2002, 10:29 AM