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

Specific headers and footers

Quote Reply
Specific headers and footers
Hi all!

I’m using headers and footers that are specific to each category. In 2.0 I specified the name of the header and footer files in their respective fields in the database and then changed the paths in links.cfg for $db_header_path and $db_footer_path so that they pointed to the right directories. Now I can’t seem to find the corresponding way to do this in Links SQL. If I use the templates that came with Links SQL nothing shows up and if I use my old templates (where the tags are <%header%> and <%footer%> ) the name of the files that are to be included are displayed.

Any ideas?


------------------
-----------------------
Per S.
Quote Reply
Re: Specific headers and footers In reply to
Hi Per S,

Yeah, that's one of several differences. Links SQL templates now allow this command:
<%include filename.txt%> and it will suck in the file on the build and parse the information so you can use variables in these external include files.

The header and footer fields could really be used for anything I figure. They accept and return html preview when viewing. So if you want to use that field for your header and footer you'll put the HTML code in the fields. (That's what I first thought the header and footer did in Links 2.0)

Now, When you view items through view or modify or delete, you will see the HTML preview as normally interpreted by the browser. (i.e, if you put <img src=something.jpg> and the relative path is incorrect, you'll see a broken image, but if you use the <img src=http://your.domain.xxx/properpath/image.jpg> you'll see the image. You'll also get bolding and whatever else)

This may or may not be good. I didn't try it with tables which I just assumed would cause problems if you left an open table or cell in the header. I personally have steared away from using it because I installed multiple category templates (there's a thread here somewhere) which better served my purposes. I haven't tried putting <%include file.txt%> in the header or footer. Don't know what'll happen. So experiment with it.

Hope this helps.

Peace.

Kyle
Quote Reply
Re: Specific headers and footers In reply to
Thanks Kyle!

It kind of helped. Or at least gave me some kind of insight in to the differences between 2.0 and SQL. Unfortunately the problem is still there and I don’t seem to be able to solve it.

I have ten main categories and they all have their own headers and footers. Actually it’s a table that’s started in the header and ended in the footer. In a cell parallel to the links there’s a column containing dynamically included news items for that category (done with NewsPro). I’ve been promising our customer the conversion to Links SQL would be finished tomorrow so I’m in a bit of a tight spot.

I would so much like to find a solution that would make it work just as with 2.0, that is the word that you type in the header field in the database is the name of the file to be included. That way I wouldn’t have to go through all the categories and change. There are a few hundred...


------------------
Per S.
Quote Reply
Re: Specific headers and footers In reply to
Found it!

I was scrolling through the nph-build.cgi when I found the folowing:
# Get the header and footer from file if it exists, otherwise assume it is html.

The default paths are set to {admin_root_path}/headers/ and {admin_root_path}/footers/.

It’s at times like this you wish you had a big fat manual for Links and you could have saved half a day’s work. But I guess a manual for Links would take away part of the fun Smile


------------------
Per S.
Quote Reply
Re: Specific headers and footers In reply to
That's what the forum is for Smile

IT's a big fat, reasonably up to date manaual.

Quote Reply
Re: Specific headers and footers In reply to
Check the FAQ... I think it's indexed in there (I'm a good 30 days behind now)

But, one suggestion was to use the header and footer area of the category screen in the admin area for this.

Each category can have a different header/footer, and I think there is an official way of making it an include file. Because so many different ideas were tossed out (two of them mine) I don't really remember which is the "correct" way -- but it was given!

Right now I'm lucky to remember my name -- but search the FAQ for "header" or "footer" and it should show up -- otherwise try this forum. It was about a month+ ago.



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