Gossamer Forum
Home : Products : Links 2.0 : Customization :

Re: header and footer

Quote Reply
Re: header and footer In reply to
Ummm, where did you get the idea that using templates excludes headers and footers? You can do both. Here is the scoop on headers and footers:

1. There are category headers and footers which are defined in category.def and appear in the add and modify a category displays on the admin screen. One of two things can go into those fields when adding/modifying a category:

a. The name of a file which is contained in a links/admin/header or links/admin/footer directory. These files can contain plain text or html.

b. HTML code or text that you want to display as a category header or footer. I do recommend doing this; it is better to create separate header and footer files and putting the in the directories mentioned above and point to them by putting the name of the file (excluding the path) in the fields.

When the category pages are built, Links looks in these fields for each category. No matter what is in the field, Links will see if it matches a header or footer file in the appropriate directory. If it does, then the contents of that file will be used. If it does not, then whatever is in the field will be used. To use the fields with templates, the <%header%> or <%footer%> tags should be in the category.html template file in the position where you want the header or footer to display. If not using templates, then $header and $footer are used instead of the tags (in sub site_html_category, site_html.pl).

2. You can also create headers and footers that will be used for all (or most) Links pages by including them as variables at the top of site_html.pl or site_html_templates.pl (above the %globals = ( line, something like this (as used on my site):
Code:
$site_menu = qq~[
<a href="$build_add_url">Add</a> |
<a href="$build_modify_url">Modify</a> |
<a href="$build_new_url/$build_index">New</a> |
<a href="$build_cool_url/$build_index">Cool</a> |
<a href="$build_ratings_url/$build_index">TopRated</a> |
<a href="$build_search_url">Search</a> |
<a href="$build_email_url">Newsletter</a>
]
[
<a href="$build_root_url/GuestBook/$build_index">Guestbook</a> |
<a href="/cgi-bin/BNB/birdcast.cgi">Recommend This Page</a> ]
~;
Then, change this code (if using templates) in site_html_templates.pl:
Code:
%globals = (
date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,
site_title => $build_site_title,
css => $build_css_url,
banner => ''
);
to read:
Code:
%globals = (
date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,
site_title => $build_site_title,
css => $build_css_url,
site_menu => $site_menu,
banner => ''
);
The tag, <%site_menu%>, can now be used in any template loaded by Links or the variable, $site_menu, can be used in any subroutine of either site_html.pl or site_html_templates.pl.

3. You can use SSI to load any file on any static HTML page created by links, if your Links is configured correctly.

4. You can install the Enhanced Template Mod and then include any file just about anywhere (the files to include MUST be in the templates directory).

So, as you can see, having headers and footers is possible with templates or without templates and there are quite a few ways to implement them.

I hope this helps.

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Subject Author Views Date
Thread header and footer bilbong30 17048 Jul 11, 2000, 9:08 AM
Thread Re: header and footer
Cebidae 16830 Jul 11, 2000, 12:29 PM
Thread Re: header and footer
Bobsie 18975 Jul 11, 2000, 4:23 PM
Thread Re: header and footer
avern 16711 Aug 10, 2000, 12:21 PM
Thread Re: header and footer
sponge 16678 Aug 10, 2000, 2:11 PM
Post Re: header and footer
TigerLily 16414 Aug 30, 2000, 7:25 PM
Thread Re: header and footer
jdunes 16410 Sep 1, 2000, 10:32 AM
Post Re: header and footer
jdunes 16345 Sep 1, 2000, 10:41 AM
Thread Re: header and footer
ultimate 15588 Oct 27, 2000, 3:33 AM
Post Re: header and footer
Stealth 15328 Nov 13, 2000, 6:58 PM
Thread Re: header and footer
wirefram 15124 Nov 29, 2000, 8:42 PM
Thread Re: header and footer
Stealth 15112 Nov 29, 2000, 8:48 PM
Thread Re: header and footer
wirefram 15121 Nov 29, 2000, 9:25 PM
Post Re: header and footer
Stealth 15102 Nov 29, 2000, 9:30 PM
Thread Re: [Bobsie] header and footer
taipan 12503 Jan 26, 2003, 4:22 PM
Thread Re: [taipan] header and footer
PerlFlunkie 12513 Jan 27, 2003, 2:28 PM
Post Re: [PerlFlunkie] header and footer
taipan 12406 Jan 27, 2003, 9:51 PM
Thread Re: [PerlFlunkie] header and footer
taipan 12394 Feb 3, 2003, 10:27 PM
Thread Re: [taipan] header and footer
PerlFlunkie 12413 Feb 3, 2003, 11:33 PM
Thread Re: [PerlFlunkie] header and footer
taipan 12410 Feb 4, 2003, 11:50 AM
Thread Re: [taipan] header and footer
PerlFlunkie 12402 Feb 4, 2003, 8:13 PM
Post Re: [PerlFlunkie] header and footer
taipan 12377 Feb 4, 2003, 10:17 PM
Post Re: [Bobsie] header and footer
taipan 12393 Feb 3, 2003, 10:21 PM