Gossamer Forum
Home : Products : Links 2.0 : Customization :

<%footer%>

(Page 1 of 2)
> >
Quote Reply
<%footer%>
I am still having a problem with my header/footer. It is now included with each template. The problem I am having is with the footer. For some reason it is printing the header at the top and the header AND the footer at the bottom. I have no idea why it is doing it. It doesn't do this on any other page except Links 2.0 templates, so it would have to be something with the routines, right? Here they are:


sub header {
# ---------------------------------------------------------
# This routine includes my header file

my $header = "/home/jdr7181/www/header.txt";

open(HEADER, "<$header") || &cgierr("Couldn't open $header : $!");
while (<HEADER>) {
$output .= $_;
}
close(HEADER);
return $output;
}


sub footer {
# -------------------------------------------------------
# This routine includes my footer file

my $footer = "/home/jdr7181/www/footer.txt";

open(FOOTER, "<$footer") || &cgierr("Couldn't open $footer : $!");
while (<FOOTER>) {
$output .= $_;
}
close(FOOTER);
return $output;
}

This was taken straight from these discussion groups. What am I overlooking? What else could it be?

Please help me with this.

Jack


Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Make sure that you have the following codes in the %globals hash in the site_html_templates.pl file:

Code:

footer => &footer,
header => &header


NOT

Code:

footer => $footer,
header => $header


Regards,

Eliot Lee
Quote Reply
Re: <%footer%> In reply to
Yeah, Paul Wilson pointed that out to me. Up until then, I couldn't even get the header and footer to show up. I corrected the variable declaration and now it comes up with both the header AND the footer where just the footer should be. You can see what I mean at http://www.soapvoice.com/cgi-bin/links/add.cgi

Any other ideas?

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Did you get it fixed? The link you gave works fine for me Wink

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: <%footer%> In reply to
Are you serious? No, it's not workinig for me. Are you sure the header wasn't at the top AND the bottom?

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Yeah Andy is wrong, I see what you mean.

Make sure you only have <%footer%> at the bottom of the add.html template.

Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com

Quote Reply
Re: <%footer%> In reply to
Yeah, sorry about that. My browser must have been messed up. I saw the bit saying SoapVoice.com : Add Link, and then the end was the bit saying Links Engine Powered By: Gossamer Threads.

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: <%footer%> In reply to
Yeah, I have checked that repeatedly. Only one <%header%> at the top and one <%footer%> at the bottom.

I just overwrote all templates (by uploading the originals again) and tried again. It still does both at the footer.

There has to be something? I've checked the footer.txt file. It has only the appropriate html coding. Besides, if it didn't all my other (non)links pages would have the same problem. This is affecting only the template pages generated. I have tried it on both add, modified and one other and it does the same thing regardless of which one I add the footer. I am going to try something, but please if you have any idea what's causing this, I would appreciate it.

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
I just tried something. I deleted the <%header%>, saved and checked it out. No header, but the footer included both the header and footer. Then I deleted the <%footer%>, saved and checked it out. Header was fine, wrapped the whole screen, no footer.

There must be some code somewhere in the templates or the scripts that I am missing. I don't know.

Please someone, if you can help, I would really appreciate it.

Thanks,

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Tried something else. The templates I used are customized, so I instead uploaded the default add.html from Links and added the header and footer tags at the top and bottom of the file. Same problem. Header is fine, footer has both header AND footer.

Any ideas?

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Doesn't anybody have any idea about this? Please. Surely there is some way of fixing this.

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Open your header file and type something in - maybe your name. Upload the header file to your server and open the web page. Does what you typed in appear in both the top and bottom "header"?

Gene
Quote Reply
Re: <%footer%> In reply to
How strange. It does show up on my regular pages that use the header and footer properly, but it doesn't on the templates I added the <%footer%> to. What does that mean? Hmmm . . .

Jack


Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
I means that either

1. the footer file contains the a different header file

or

2. there is a second header file being generated in another section of your links code.

TO TEST:

1. leave the header file in your code and put a second identifying word in it.

2. Download the footer file and examine it for the second header info.

3 Remove the reference to <%footer> and then run build and look at the headers/footers.

4. Remove the footer file from the server ( rename on the server e.g. from footer.txt to footerA.txt ) and then run build and look at the headers/footers.

By removing the footer file, you can pinpoint the location of the second header file. One way or the other, this will pinpoint the location of the second header info.

If after you remove the footer file, the header info still prints out, then you'll have to look in the links code for the second header info. If the second header info does not print out, then the second header info is in the footer file



Gene
Quote Reply
Re: <%footer%> In reply to
I tried some of this (reference an ealier post in this thread). I removed the reference to the header file in the templates, built pages and then viewed them. The footer at the bottom consisted of both the header and footer. I then added the header back and deleted the reference to the footer, built pages and then viewed them again. This time the header was fine and there was no footer at all. The interesting thing is, the header code starts several tables that are concluded in the footer code. How could those tables form right without the footer? It did. The table (at least one) was complete.

I have also checked the footer file repeatedly; there is no additional header code in that file. This all begs the question: How can a second header file (identical to the first) be generated in another section of the links code?

I will perform your test again, however, and let you know how it goes.

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
OOPS! My mistake. The test (and another test) does show up in the templates. I probably failed to build the pages after updating the header. Sorry.

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Well, I deleted the reference to the footer file and built the pages again. When I viewed the pages I noticed that the test remark I added to the header did, in fact, appear. With the footer reference included it appeared at both the top and the bottom.

Let me explain some about my header and footer.

There is one table that runs the entire circumference of the screen (border=0, width=100%). This table started out as simply a placeholder. I could delete it with no impact on my site. I just haven't yet. There is a table inside of that one (border=5, width=850) that consists of 3 columns, and 2 rows. This table contains a header table at the top, the menu and main body under that, then the footer makes up the second row. There is a third table (header table: border=0, width=800) that consists 1 row and 3 columns. This is where I have a quote in one column, the logo in the middle column, and a back button in the third. This table closes in the header. All other tables are closed in the footer.

I don't know if that helps or not. I am going through my code to see if there is something in it that might be causing this. But I don't see how it is.

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Now, I just pasted the code from my header and the code from my footer into the cool.html template and it worked perfectly. So it is definately something to do with the <%header%> and <%footer%> calls.

HELP! :)

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
I have narrowed it down even further. I deleted the header code and added the <%header%> call. Built pages and viewed. Worked fine. Then I deleted the footer code and added the <%footer%> (now both header and footer calls are in the template) and the same problem came up. Definately a problem with the footer variable or routine. I also tried with the full header code and just the <%footer%> call and had the same problem. The only time it works is if I have the full code of both or just the footer code with the <%header%> call.

Any idea what is causing this?

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Lots of headers and footers and building and etc etc. Smile

One interesting thing you said was that you tried them in another file and they worked fine. At least I think I read that.

Try this. Move the <%header%> and <%footer%> outside the table. From what you described it would look something like

< HTML >
< HEAD >
< /HEAD >
< BODY >
<%header%>
< TABLE >

etc

< /TABLE >
<%footer%>
< /BODY >
< /HTML >

If that works, then:

It may be that you are missing some < TD >s, < /TD >s, < TR >s or < /TR >

To test that you a can download Tidy from the following ( it's little old but and far from perfect )

http://www.w3.org/People/Raggett/tidy/

Or download First Page ( it's free, or was ), Tidy is built into it.
http://www.evrsoft.com/

I still use Claris Home Page ( ugh! ) to "fix" somethings and to view WYSIWYG


Gene
Quote Reply
Re: <%footer%> In reply to
I don't know if the author is still keeping up with this thread, but... you can't use $output as your variable name in each function. Use $output_header and $output_footer.

Quote Reply
Re: <%footer%> In reply to
I forgot the my.

You can use $output for both if you use:

my $output =

Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com

Quote Reply
Re: <%footer%> In reply to
I got it working! I moved the templates directory outside the cgi-bin, updated the appropriate path to the templates directory, added my header.txt and footer.txt file to that directory and then used <%include header.txt%> and <%include footer.txt%>. That worked fine.

Now my only problem is I also have a menu.txt file in that directory that is a java applet that generates my menu. When I add <%include menu.txt%> to the templates it just puts a gray box where my menu should be and gives me an error stating it couldn't fine the coolnav.class file used by the applet to generate it.

hmmm . . .

Jack

Administrator
SoapVoice.com!
Quote Reply
Re: <%footer%> In reply to
Use a full path to coolnav.class.

Quote Reply
Re: <%footer%> In reply to
I have tried that I get an error message stating it could not fine home.jdr7181.www.SSI.coolnav.class

Jack

Administrator
SoapVoice.com!
> >