Gossamer Forum
Home : Products : Links 2.0 : Customization :

Enhanced template! Can I include a file outside template directory?

Quote Reply
Enhanced template! Can I include a file outside template directory?
Hello everybody,

Ok, ok
It's mentioned several times in this forum. I know!!
But a search through all related questions brings me nowhere!
Some say it won't work and some say it doesn't.

Can somebody give me a solution answer for this please:

I use the enhanced template.pm to include a file. I works great without SSI!! Great work! But this one only wants to include a file that's in the template directory. But I want to include a file that's outside this directory.

Sorry again. mentioned many times before in the forum, but I can't find the solution.

Thanx,
Ron
Wink
Quote Reply
Re: [rsahertian] Enhanced template! Can I include a file outside template directory? In reply to
well, I am certainly no expert but....

I installed the enhanced templates mod. As I recall while I could run the standard templates with the <%include filename.txt%>, I had a problem trying to include non-links pages with the following:

Code:
<!--#include virtual="/home/acct/cgi-bin/links/admin/templates/banners.html" -->
So, I moved my templates to a folder outside the cgi-bin folder:

from: /home/acct/cgi-bin/links/admin/templates ( as I recall )

to: /home/acct/public_html/templates

and reset the templates path in links.cfg

this allowed me to use the same code for both the links and non-links pages and I was ( and remain ) a happy camper!!!

I will leave it up to the experts as to whether or not you can use the <%include xxxxxx%> for non-links pages. I couldn't but maybe there is a way.

And so that I did not have to rename all my files from htm to html, to my .htacces file I added
Code:
AddType text/x-server-parsed-html .html


Maybe I was just lucky....

That's all I know, I don't know no more!!! Crazy


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Enhanced template! Can I include a file outside template directory? In reply to
Either that, or edit the enhanced template mod to not look in the templates folder, but rather take the position sent via the tag. I.e, instead of using;

<%include test.txt%>

use somethig like;

<%include /home/site.com/public_html/file.txt%>

I'm just off out now...so I can't be definate on this answer..if its still not answered by the morning, I'll have a go :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!