Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Header & Footer In Adding New Category

(Page 1 of 2)
> >
Quote Reply
Header & Footer In Adding New Category
I've searched and searched and "think" I understand. When setting up the script and adding new categories, nn the 'header' and 'footer' I simply put the link to the file that contains my header and footer text/banner/whatever, i.e. http://www.yourdomain.com/header/Category1.txt.

Then, once the category pages are all built, I go into the template and add <%Header%> and <%Footer%> where I want it to appear, right?

So, I then assume I have to create a header and footer file for each category? I'd create a directory called /header and then put Category1.txt, Category2.txt, etc, and do the same with /footer?

Forgive a newbie for asking what may appear to be (the first of many, I'm sure) dumb questions

:)



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
I've never really used this feature, but AFAIK, you need to upload the files into your admin/templates folder.. They can be called whatever you want (i.e my_header.txt%> ... then in your category.html templates, just use;

<%header%> or <%footer%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Header & Footer In Adding New Category In reply to
Ok, so there will be just one categories.html file? Each category does not have its own page? I think I understand that :)

I then build each category footer/header in a separate file rather than a separate category file for each category.

Makes sense :)



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
I think so. The other option is to add another field in links.def (for example: <%footer_code%>), and then when you create the categories, you can just enter the HTML you want for the particular category.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Header & Footer In Adding New Category In reply to
To be able to use <%header%> and <%footer%> tags, I believe you need to use the Advanced Template Support mod, here:

http://www.gossamer-threads.com/...rsion_2_x/more2.html

Are you wanting one header/footer for everything, or different one for different categories? The field in the admin are great to use if you want multiple header/footer looks, otherwise use the tag method.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
The enhanced template mod is mainly for using <%include filename.txt%>, whereas the <%header%> and <%footer%> stuff enables you to have different files for each category, without having to use different templates, and also modifying site_html_templates.pl (I could be wrong.. but this is my understanding of the matter).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Header & Footer In Adding New Category In reply to
Duh, that's right! I do use the tags <%includer header.txt%>. Using <%header%> shoulc call the one you want IF you placed a apth to it in the admin area when you created the cat. My bad...


Leonard
aka PerlFlunkie
Quote Reply
Re: [Andy] Header & Footer In Adding New Category In reply to
Well, now I'm totally and thoroughly confused.

I changed the category and added a footer to it, and the footer was http://www.yourdomain.com/...ates/nameoffile.html

I uploaded nameoffile.html into the templates directory as you said.

When I go to that category, there is nothing there.

So, I have to go to that category, open the index.html file, and manually add in a <%footer%> tag at the bottom?

Each category will have a different footer.


Edit: Went into the category index.html

!-- Related Categories -->

br>
<%footer%>

br>


!-- Search Bar -->



All that shows up now is a space in the page, no footer, no banner, nothing whatsoever





I'd like to be alone in a room, and enjoy the company.

Last edited by:

hairy: Nov 12, 2003, 5:07 PM
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
Study this thread, see if it helps:

http://www.gossamer-threads.com/...cgi?post=93433#93433


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
That's a lot to digest at 7 am, but it appears to be what I want, thanks, I'll read the entire thing when I'm more coherent :)



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
Ok -- so -- tell me please what I've done wrong :)

1. Category.html has a <%footer%> tag where I want the footer banner to appear.

2. When I created the category, under footer, I put http://domain.com/...es/categoryname.html

3. Under index.html for the category listed, I added the <%footer%> tag.

When I open that category and check it, instead of a banner there, all that appears is http://domain.com/...es/categoryname.html

Yes, only the html coding appears ... and I did what was suggested as well, put only /links/templates/categoryname.html in the footer info in the category and it won't work, either



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
I think you're error is in putting an URL where you only need a file name: (from the thread linked, emphasis added)

b. HTML code or text that you want to display as a category header or footer. I do NOT 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.


So instead of http://domain.com/...es/categoryname.html

just use categoryname.txt

Also, the templates directory normally IS in the cgi-bin. I suspect this was done just to make it easier to protect; keep all protected files in one directory (admin). They should work fine where you have them, as long as you have the links.def file set right. Reread the thread I linked, near the end (about half way through) and you should see how to set this up.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
I've read and read and read and read.

It works. You're awesome, too

Thank you :)


Edit: It stopped working when I moved the link but after I did a 'build all' it came back, so I think I learned more -- if you make any changes, you have to build for it to show, no?


Edit 2: apparently not, as I moved the

<br><%footer%>

<br>

tags up 2 lines and now they won't change, no matter how many times I build




I'd like to be alone in a room, and enjoy the company.

Last edited by:

hairy: Nov 13, 2003, 12:24 PM
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
try putting the <%footer%> tag on its own line, instead of after the <br>

<br>

<%footer%>

<br>



Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
The break tags don't seem to work ...



I have it as <%footer%>

<rb>

<br>

Yet there is no break at the bottom of the banner and it goes right to the copyright notice



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
A single <br> just ensures nothing else will be on that line (following the tag), to create a space, use two or more tags together: <br><br>

Yes, any change made will require a rebuild for it to take effect.

Is your footer showing up? Just not exactly where you want it?


Leonard
aka PerlFlunkie
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
Ok, this is VERY very odd.

The script is pulling in html coding I'm not even putting in.

Let me demonstrate:

1. The actual index.html file coding is as follows:

<tr><td><small class="more"><a href="http://www.blahblah.com/cgi-bin/search.cgi">More search options</a></small></td></tr>

</table>

</div>

</form>

<br>

<%footer%>


<p>&nbsp;</p>


<p><small class="update">Pages Updated On: 12-Nov-2003 - 17:48:27<br>

Links Engine 2.0 By:
<a href="http://www.gossamer-threads.com/">Gossamer Threads Inc.</a></small></p>

2. When you go to the page after doing a build, and look at the source code, it's as follows, with head/body/etc tags duplicated

<tr><td><small class="more"><a href="http://www.blahblah.com/cgi-bin/search.cgi">More search options</a></small></td></tr>
</table>
</div>
</form>
<br><HTML>
<HEAD>
<TITLE> Title is inserted here </TITLE>
</HEAD>
<BODY>

<center><a href="http://www.thereisaurl.here"><img src="http://www.blahblah.com/images/image.jpg"></a></center>

</BODY>
</HTML>
<br<
<p><small class="update">Pages Updated On: 13-Nov-2003 - 16:39:15<br>
Links Engine 2.0 By: <a href="http://www.gossamer-threads.com/">Gossamer Threads Inc.</a></small></p>






I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
What do you have in the file for your footer? It does not need to be a full html page with <head> etc, just a bit of code that gets inserted into your other code. Also, always helpful to post a link to your site, so we can see what you're talking about.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
Ahh, let me remove that stuff and try it, duh:)

Well, the only think on that page -- nameofcategory.html -- is the center tag, image tag and href tag -- NOTHING else.

I uploaded the new file, did a build, and it still shows with the same code, that is the head/etc tags in the center as well.

I don't have a path, just /nameofcategory.html and the file is under cgi-bin/link/admin/templates/

What now, Kemosabe?

:)



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
This next bit is copied from the thread I linked to previously:




You only need one header folder and one footer folder, like so: /links/admin/header and links/admin/footer. Then suppose you have three different headers, head1.txt, head2.txt, and head3.txt. All three go into the one header folder. Then, for each (sub)category, enter the name of the file you want to use, example: head2.txt




So, instead of putting the .txt files in here:

cgi-bin/link/admin/templates/

Put them here: /links/admin/header & /links/admin/footer


We'll get this going eventually...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
This just isn't working. I deleted it from templates and moved it into cgi-bin/links/admin/footer/

The footer reference in that category is simply categoryname.html -- no path at all.

I just made a change in the file and uploaded it, and did a build, but it won't show the change in html. It still shows the code from 2 days ago.


<br<
<p><small class="update">Pages Updated On: 14-Nov-2003 - 11:28:16<br>
Links Engine 2.0 By: <a href="http://www.gossamer-threads.com/">Gossamer Threads Inc.</a></small></p>

I fixed that broken tag 2 days ago, and looking at the actual index.html file in that category, I show

<br>

<%footer%>

<p>
&nbsp;</p>



<p><small class="update">Pages Updated On: 12-Nov-2003 - 17:48:27<br>

Links Engine 2.0 By:
<a href="http://www.gossamer-threads.com/">Gossamer Threads Inc.</a></small></p>



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
Actually, I haven't used this technique, but I have read about it and I think I understand it. Sounds like you have it down, but try changing the .html extension to .txt. Also, the first <br> tag you have is wrong: <br< Following is my understanding of how to get this to work:

In the admin, when you add/modify a cat, enter the name of the file you want to use in the header or footer field. Examples:

header1.txt

footer1.txt

Then create the directory you need to put all headers into, and the directory for all footers:

/cgi-bin/links/admin/header

/cgi-bin/links/admin/footer

Then upload the txt file into the proper directory. The full path would look like so:

/cgi-bin/links/admin/header/header1.txt

This should work. The txt file is basic html, just the code you want inserted into the category page.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
That's my point, I fixed that broken tag 2 days ago and uploaded the file and it still shows the old file with broken tags. I've uploaded, built everything, and it still shows as broken, which makes NO sense at all.

I *had* the full path previously but y'all told me not to, so I changed it -- I'll go change it back, rename the file to .txt, and hopefully it will work.

If not, I'l be back :)



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [PerlFlunkie] Header & Footer In Adding New Category In reply to
Oh well

Instead of the banner showing up now, it merely shows the text

/cgi-bin/links/admin/footer/red.txt
Pages Updated On: 14-Nov-2003 - 12:02:33



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Header & Footer In Adding New Category In reply to
By removing the full path I was able to get the banner to show up -- but -- it's still reading the index.html file I changed 2 days ago.

I uploaded the new index.html file -- again -- and now the banner is totally gone.

This is beginning to get very frustrating and I can't seem to figure out why it's doing these things.

By uploading the new html file, I've now lost listings in that category. The category page shows 1 link but the actual page shows 0 links, it's lost it.


Not only that, it still says I updated it November 12 and NOT today so that leads me to believe there is something I'm not updating, something in the script isn't updating correctly.

Now it's losing links :(


Edit: By doing a build I got back the missing link and the banner, BUT the code still has the broken <br< tags that I fixed 2 days ago.



I'd like to be alone in a room, and enjoy the company.

Last edited by:

hairy: Nov 14, 2003, 1:13 PM
> >