Gossamer Forum
Home : Products : Links 2.0 : Customization :

Adding a header to a category

Quote Reply
Adding a header to a category
Hi all, I'm very new to this.

I'm trying to setup a header (what I understand of headers are [correct me if I'm wrong] some HTML code that I would like to appear at the top of the category page when somebody goes in)

I did a Modify category,
In the header field I typed header.txt and I also tried it header.html
under the admin dir I created a header dir and in it I placed header.txt (header.html)

I rebuilt the directory and I still don't get any headers? Is there a variable I need to set to get headers working?

Thanks
Quote Reply
Re: Adding a header to a category In reply to
Hi,

When adding a header, you will need to add the following to category.html:

<%Header%>

This will allow whatever you type in the respective category to appear where you put the header call in the text.

Good Luck
SPH
Quote Reply
Re: Adding a header to a category In reply to
I'm having a terrible time with this. I've ready many threads, with a variety of methods.

I tried <%Header%> in my "category.html" template and received an error (sorry I didn't record it, but it was something like "Invalid Header" or something)

Then I added:
<!-- Header-->
<%if Header%>
<%Header%>
<%endif%>
and that doesn't do anything.

Where can I find the recommended, standardized routines for Headers and Footers.

Thanks.
Quote Reply
Re: Adding a header to a category In reply to
I figured it out. Yeah!
It was a simple "case sensitive" issue.

I had:
<!-- Header-->
<%if Header%>
<%Header%>
<%endif%>

Should've been
<!-- Header-->
<%if header%>
<%header%>
<%endif%>
Quote Reply
Re: Adding a header to a category In reply to
That's an odd one. The "Header" field in category.def is capitalized. Therefore, the <%Header%> should also be capitalized unless, for some reason, category.def was changed.

Moot point since it works for you the way you have it now. I just find it curious.
Quote Reply
Re: Adding a header to a category In reply to
Okay now here's a real good question. We can use header inserts in category.html but what would you suggest for other template files like add.html, et al? Just hard code banners?
Quote Reply
Re: Adding a header to a category In reply to
You do not need to use the category's header field to create a header. If you have a header that is going to be on each page, regardless, just set it up at the top of site_html_templates.pl (above the %globals variable) like this:

$site_header = qq|header text or html code goes here|;

Then, include this in the %globals hash:

site_header => $site_header,

You will now be able to use <%site_header%> in any template file.

I hope this helps.