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/