Gossamer Forum
Home : Products : Links 2.0 : Customization :

SSI header & footer

Quote Reply
SSI header & footer
Hey,

I was browsing through posts immensly to find the answer but I cant quite grasp it.

I am trying to include a header and footer in my templates to give my links 2.0 a customized feel to match my site. BUT they both (header.txt and footer.txt) have server side includes on them. I have already changed my links.cfg so all files will build .shtml and ive already deleted the old .html pages and rebuilt with .shtml

I have read in one of the posts that the easiest way to do this is with a MOD using <%include header.txt%> and <%include footer.txt%> and then putting both the header.txt and footer.txt in the templates directory.

I have went to a site containging alot of mods and tutorials, i think its glenus site. not sure. But I did not see the MOD on there. Can someone please point this out to me? Or am i even going about this the wrong way?

Reminder: I am trying to make all my pages customized and looking the same by including a header and footer with a mod, BUT the template I of my site has SSI on them.

ANY advice or TIPS at all is GREATLY appreciated. PLEASE reply.

http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
It's easy since you've already re-built your pages with .shtml extensions. Just include the header and footer files with normal SSI. That's what I do on my site, no mod needed. Example:

<--#include virtual="/full/server/path/to/header.txt"-->
normal template code here
<--#include virtual="/full/server/path/to/footer.txt"-->

Notice I've left off the ! that needs to be part of the SSI. When included, it doesn't post correctly. Hope this helps.

Later... Ryan

Quote Reply
Re: SSI header & footer In reply to
Ok. I tryed without the "!" and it just shows the text normally but then i put in the "!" and it shows "[an error occurred while processing this directive]"

I have them chmoded correctly and the paths are correct. What could be the problem?

http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
No one knows why it wont work ?

i would list waht i tryed but i type the includes in and then push preview and they dont show up ?


And I've even tryed others.. Ive also tryed the full URL instead of the path.

ANYONE?... PLEASE?...

http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
Put the header and footer into site_html_templates like:

sub header {

my $header = qq|This is my header|;

return $header;

}


sub footer {

my $footer = qq|This is my footer|;

return $footer;

}

Then in the globals at the top add:

header => &header,
footer => &footer

...and then in your templates you can put..

<%header%>
<%footer%>

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: SSI header & footer In reply to
are you sure its not:

header => $header,
footer => $footer


and where do i put the header and footer code you mentioned, not the globals. and do i need to customize anything on it?

http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
I must be doing something wrong or you gave me some wrong codeing. because I add what you told me and i then get an error when trying to build. Please be specific in what I have to customize to make it work, where to place code, exact file names, and anything else :)

PLEASE.

http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
If you are trying to get .shtml pages to show it (not CGI pages) then all you need to use is the SSI code that Ryan posted earlier, but don't use the path! With SSI you can use the virtual path (e.g. /folder.cgi).

Note, that when doing this the folder always looks at it from the base directory, no matter where it is on the site Smile

Also, the mod you are refering to (to be able to do <%include header.txt%> tags) is the Enhanced Template Mod (http://www.gossamer-threads.com/...es/Detailed/877.html)

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: SSI header & footer In reply to
I did give you good instructions and no it isn't the code and yes I am correct - it is &header not $header

Once again, put the code I supplied into site_html_templates.pl and add:

header => &header,
footer => &footer

into the GLOBALS at the top making sure that all but the last global has a trailing comma.

Then put the tags I already mentioned into your templates.

I'm afraid I can't make it clearer than it already is.



Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: SSI header & footer In reply to
Thanks! The mod worked great.

Now about SSI in my header and footer.

I have a SSI in my header.txt located in mydomain.com/cgi-bin/links/admin/templates including the following file www.mydomain.com/main_left.html

Do I run the SSI as if It were coming from the templates foler or my directory folder located at www.mydomain.com/directory/pages

if i run it from the directory it would look like this am i correct?

< !--#include virtual="../../main_left.html"-->

without the space of course. is that correct?

Sorry this might be dumb questions but I've tryed many paths and it always says..

[an error occurred while processing this directive]

And that throws my whole design off. :(


http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
please do not think i am not grateful. I am very much:)

this is the code you gave me.

sub header {

my $header = qq|This is my header|;

return $header;

}


sub footer {

my $footer = qq|This is my footer|;

return $footer;

}



am i suppose to replace "This is my footer" and "This is my header" with the actual html code ?

If that is so then, I did not know that and i dont think any newbie without knowing perl would know that.

Thanks for all the help!

http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
Yes you replace "This is my header" and "This is my footer" with html. Basic example below...

Eg:

sub header {

my $header = qq|
Welcome to <b>MySite</b>, hope you like it!
|;

return $header;

}

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: SSI header & footer In reply to
I'm sorry my posted contained an error. As youradds pointed out, when using SSI you should use the virtual path, not the full server path. My code should work now... or if you have the mod working, go with that.

Quote Reply
Re: SSI header & footer In reply to
Can some one please help?

I have installed that Enhanced Template Mod (for ssi eg. <%include file.shtml%>) it went good.. it works fine :) BUT here is the problem.

on the <%include file.shtml%> I have SSI but i always get [an error occurred while processing this directive] CAN ANYBODY PLEASE HELP? I have been slaving at this for a long time now :(

Here is the page producing the error:

http://www.hiphopgateway.com/directory/pages/index.shtml

PLEASE RESPOND.. someone

THANKS.

http://www.hiphopgateway.com
http://www.diligentimpact.com
Quote Reply
Re: SSI header & footer In reply to
Please post the SSI code you are using so we can see what you are trying to use Wink

Andy

webmaster@ace-installer.com
http://www.ace-installer.com