Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

right category+banner

Quote Reply
right category+banner
Hi

How can i put different banner ads in different categories.Example if i want
in Advertising category - advertising banner,
in Jobs category - Jobs banners , Customer Service Category - costumer service banners.
Is there a solution for that?

Best Regards
Oliver

p.s: all that for links SQL.

[This message has been edited by oliver9 (edited December 14, 1999).]
Quote Reply
Re: right category+banner In reply to
You could put the banner html you need in the Header field for the category and then use <%header%> tag wherever you want it to appear.

Cheers,

Alex
Quote Reply
Re: right category+banner In reply to
Thanks Alex
it works fine now..

Regards
o
Quote Reply
Re: right category+banner In reply to
Cool!!! I don't know why that didn't occur to me in all this time!

Great tip!

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: right category+banner In reply to
Alex,

In keeping with this, a few things immediately come to mind.

1) If I remember, include files are parsed, but tags aren't. Is it possible to parse category tags, so that the <%header%> tag can include <%include%>s in it? That way, the correct tags can be put into each category page, but to edit the actual data files you can just edit a string of text files, rather than dealing with the admin screen? Another way to do it would be to check the header field for an <%include...%> and if it finds that to include and parse it, otherwise, just inlude the text literally. Again, what this does is allow the category to have the correct "calls" in it, and the data can be easily edited external.

2) can there be an option to allow the category header to apply to all categories BELOW it as well? I don't know what the best way to do it would be, but I guess it would be like a stack where the current header, if it exists is pushed onto the stack, and if the sub category is "inherit" it takes the last valid entry off (maybe tied to the Category_Heirarchy). I could see this becoming complex... but the goal is really to allow subcategories to inherit the category tags from the parents, without having to edit each one -- for large directories, this would be a major feature.

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: right category+banner In reply to
1. Make a directory called headers off of the admin and place a file called 'cat1.txt' in it. Then for a category just put 'cat1.txt' in the header field and the script will put the contents of that file in the <%header%> tag. Does this accomplish what you are looking for?

2. This is a good idea. You can do this with a little SQL right now:

UPDATE Category SET Header='cat1.txt'
WHERE Name LIKE 'Computers/%'

and it will set the Header field to cat1.txt for all the categories under Computers. But your right, something built in would be a little nicer.

Cheers,

Alex
Quote Reply
Re: right category+banner In reply to
OOOOhhhhh.... another undocumented feature Smile

Cool.

It's exactly what I meant....

For clarification -- does it have to be filename.txt or can it be anything like filename.inc -- as long as it's in a directory called "headers" -- case sensitivity??

If you are looking at the code again, could you make sure it follows the same rules for <%include%> files ... that way people need to only remeber one set of rules. If there is only a single token such as filename.txt (or category1) it's considered a file and checks the "headers" directory, everything else is a literal replacement.

Quote Reply
Re: right category+banner In reply to
The code works as follows:

1. Look at what is in the Header category.
2. If it is defined, less then 26 characters long, does not contain any spaces and admin/headers/theheader exists (where theheader is what we are looking at) then it's a file and the contents of the file are placed into <%header%> tag.
3. Otherwise it's assumed it's html and the contents of the field are placed into the <%header%> tag.

One note, you can't use tags inside these files, as fields don't get parsed twice. (i.e. if <%header%> contains a tag like <%build_root_url%> it doesn't get parsed).

Cheers,

Alex
Quote Reply
Re: right category+banner In reply to
Alex,

I have tried what you have said, but it hasn't worked, it is displaying the image files in the .txt file, but not the banner tag.

Help me please

Alex
Quote Reply
Re: right category+banner In reply to
I still un clear how it works, I change the template, I go the banner on the 1st page only.

R
Quote Reply
Re: right category+banner In reply to
What do you mean by '1st page only'? Only on the home page? Did you just add the banner code to the home.htm template? You also need to add it to the category.html template.

Some examples/urls would help a lot!

Cheers,

Alex
Quote Reply
Re: right category+banner In reply to
http://24.1.111.250/cgi-bin/links/page.cgi?g=&t=adv&d=1

I end up having every ctegories have the same banner. I want different category get different banner. :<
Quote Reply
Re: right category+banner In reply to
And this header is valid for all subcategories auto?

Thanks a lot
Luchini