Gossamer Forum
Home : Products : Links 2.0 : Customization :

different header for different categories - how please!

Quote Reply
different header for different categories - how please!
Hello:

I've done the searching, but haven't come across anything solid. Do I have to edit some Links file (links.cfg), if so how and what file? Do I have to create a specific header directory, if so where and by what name? Do the header files have to be txt or html? Anything else you think would help me would be greatly appreciated.

Thanks in Advance!
Quote Reply
Re: different header for different categories - how please! In reply to
Each category record contains field for both headers and footers that can be used on the category pages. You can design the headers and footers by creating files containing the html (or text) you want to use and put them in the admin/header and admin/footer directories, respectively. The filenames for the header and footer files need to be less than 20 characters in length. You then modify the header and/or footer fields of the categories the files are for to contain just the names of the files (no paths). Each category can have its own header or footer files.

Or, you can add the html code for the header or footer directly to the category record by just putting it in the fields (I would recommend this only if the code is short).

In either case, when Links builds the category pages, it will check the fields and, if they are not empty, it will attempt to match what is there against the files in the admin/header or admin/footer directory. If it finds a match, it displays the header or footer. If there is no match, it just displays whatever is in the fields instead.

You can specify the placement of the headers or footer in site_html.pl sub site_html_category (non-templates) by using the $header or $footer variables where you want the header or footer to display. If you are using templates, you use <%header%> or <%footer%> to do the same thing, but do it in category.html.

I hope this helps.

[This message has been edited by Bobsie (edited May 18, 1999).]
Quote Reply
Re: different header for different categories - how please! In reply to
Well let see, first I made a footer and header directory under my admin directory. Then, I created a footer file (place in admin/footer) and typed it's name into the cat footer field, got nothing. So then I typed in the full url of the footer file and still got nothing. Well, then I checked the category.def and it says that 75 characters can be entered so I put the footer file in my main directory and still nothing. After each change I did a build and chmod all affected directories/files to 777. Any idea of what I'm doing wrong?

Thanks in Advance
Quote Reply
Re: different header for different categories - how please! In reply to
Do not put a URL or path in the field, just the file name. Did you use the $footer variable in sub site_html_category (site_html.pl if not using templates) or the <%footer%> links_tag (category.html if using templates)?

In site_html.pl, there should be a line like this:

Quote:
if ($footer) { $output .= qq~<p>$footer</p>~; }

In category.html (if using templates), the <%header%> and <%footer%> are not included with the default template that comes with Links v2.0. You have to add it yourself, something like this:

Quote:
<%if footer%>
<%footer%>
<%endif%>

Note that the <%if..%> and <%endif%> must be on lines by themselves.

I hope this helps.
Quote Reply
Re: different header for different categories - how please! In reply to
Great it worked Bobsie! I didn't have any idea about the

<%if footer%>
<%footer%>
<%endif%>

that's what was messing me up.

Thanks again!