Alex & GT staff,
Currently Template path used in GT::Template to include a file, is relative to the template dir:
I suggest you to make possible to use both absolute & relative paths in file includes.
1) Relative path to template directory (currently used)
__a) The relative include tag looks like following: <%include test.html%>
__b) The file is loaded from path relative to the template directory:
/cgi-bin/gforum/admin/templates/
2) Absolute path relative to the website root (my suggestion)
__a) Include tag using Absolute path should look like following:
_____1st example: <%include /cgi-bin/lsql/admin/test.html%>
(So if we use this tag in E.g: Gforum, it would be possible to use the same template even in Links SQL...)
_____2nd example: <%include /mytemplates/test.html%>
(this solution could make possible for us to use a central template repository for the whole site)
__b) So the file is loaded from path absolute from to the website root:
In 1st example the the file is included from path: /cgi-bin/gforum/admin/templates/
In 2nd example the the file is included from path: /mytemplates/
The logic to distinguish relative and absolute paths:
- if our file name starts with / sign, then we use absolute path to load the file
- else our file name is not starting with / sign, so we use relative path to template root to load the file
There are many advantages of this solution, we could even create sitewide template solutions. I think it would be a very easy & quick modification, so does not need too much work.
I'm very exited, when will this feature implemented.
Alex, I already used this kind of solution successfully, altough not in LSQL, yet.
I think, I could do the change, but I don't want to do any changes in main LSQL module codes, to maintain my LSQL compatibility.
Let me know, what do you think about suggestion, and if you want to implement it or not.
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...
Currently Template path used in GT::Template to include a file, is relative to the template dir:
Quote:
must be in the template's root directory which is defined using $obj->root, or '.' by default.1) Relative path to template directory (currently used)
__a) The relative include tag looks like following: <%include test.html%>
__b) The file is loaded from path relative to the template directory:
/cgi-bin/gforum/admin/templates/
2) Absolute path relative to the website root (my suggestion)
__a) Include tag using Absolute path should look like following:
_____1st example: <%include /cgi-bin/lsql/admin/test.html%>
(So if we use this tag in E.g: Gforum, it would be possible to use the same template even in Links SQL...)
_____2nd example: <%include /mytemplates/test.html%>
(this solution could make possible for us to use a central template repository for the whole site)
__b) So the file is loaded from path absolute from to the website root:
In 1st example the the file is included from path: /cgi-bin/gforum/admin/templates/
In 2nd example the the file is included from path: /mytemplates/
The logic to distinguish relative and absolute paths:
- if our file name starts with / sign, then we use absolute path to load the file
- else our file name is not starting with / sign, so we use relative path to template root to load the file
There are many advantages of this solution, we could even create sitewide template solutions. I think it would be a very easy & quick modification, so does not need too much work.
I'm very exited, when will this feature implemented.
Alex, I already used this kind of solution successfully, altough not in LSQL, yet.
I think, I could do the change, but I don't want to do any changes in main LSQL module codes, to maintain my LSQL compatibility.
Let me know, what do you think about suggestion, and if you want to implement it or not.
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...