Gossamer Forum
Home : Products : Gossamer Links : Discussions :

template hell. Please help.

Quote Reply
template hell. Please help.
Hello. I am trying to figure out the templates. Based on a previous thread I started in pre-sales, I have learned more about the concept of how they work.

It seems that the templates are all pieces of the whole. For example: you can begin and end all html documents in LinksSQL in the header and footer, and simply have the body of the html in each of the pages (like home.html, add.html etc).

What was first confusing is that I added a header and footer in LinksSQL and didn't take out the <head> </head> etc out of the individual pages like home.html etc.

Ok. So did I get that right?

Now, I have devised a html page, based on the html anthrorules provided...really just adding some html to it and using the home.html template as a starting ground. When I build, and go to the main page, I see no page. The title says: "Gossamer Threads Inc.: Unknown Tag: 'category_name'"
Looking att he source, the title is all I see.

Here is the html source I used:
-------------
header.txt
-------------
<html>
<head>
<title><%site_title%>: <╩tegory_name%></title>
<%if meta_description%>
<meta name="Description" content="<%meta_description%>">
<%endif%>
<%if meta_name%>
<meta name="Keywords" content="<%meta_name%">
<%endif%>
</head>
<body bgcolor="ffffff">
<div align="center"><center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr bgcolor="FFFFFF">
<td valign="top" width="50%">
<p><small class="menu">| <a class="menulink" href="<%build_root_url%>">Home</a>
| <%if category_id%> <a class="menulink" href="<█_cgi_url%>/add.cgi?ID=<╩tegory_id%>">Add
a Resource</a> | <a class="menulink" href="<█_cgi_url%>/modify.cgi?ID=<╩tegory_id%>">Modify
a Resource</a> | <%endif%> <%ifnot category_id%> <a class="menulink" href="<█_cgi_url%>/add.cgi">Add
a Resource</a> | <a class="menulink" href="<█_cgi_url%>/modify.cgi">Modify
a Resource</a> | <%endif%> <a class="menulink" href="<%build_root_url%>/New">What's
New</a> | <a class="menulink" href="<%build_root_url%>/Cool">What's
Cool</a> | <a class="menulink" href="<%build_root_url%>/Ratings">Top
Rated</a> | <a class="menulink" href="<█_cgi_url%>/subscribe.cgi">Email
Updates</a> | <a class="menulink" href="<█_cgi_url%>/jump.cgi?ID=random">Random
Link</a> | <a class="menulink" href="<█_cgi_url%>/search.cgi">Search</a>
| <%if Username%> <a class="menulink" href="<█_cgi_url%>/browser.cgi">Editors</a>
| <a class="menulink" href="<█_cgi_url%>/user.cgi?logout=1">Logout</a>
| <%endif%> <%ifnot Username%> <a class="menulink" href="<█_cgi_url%>/user.cgi">Login</a>
| <%endif%> </small></p>
</td>
<td valign="middle" width="50%">
<div align="center">More header info</div>
</td></tr>
<tr>
<td valign="top" width="100%" colspan="2">
-------------
home.html:
-------------
<%include header.txt%>

<div align="center"><center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" width="80%">


<h1 class="home"><%site_title%></h1>

<p>Welcome to the Links online demo. Feel free to add your own link, modify
another's or just play around!</p>
<p><font size="3" face="Verdana, Arial, Helvetica, sans-serif" color="#000000"><b>This
is the place where we'd have main content</b></font> </p>




</td>
<td valign="top" width="20%"><╩tegory%>
<p>This is the place for the navigation generated by links.</p>
</td>
</tr>
</table>
</div></center>

<%include footer.txt%>
-----------
footer.txt:
-----------
</td></tr>
<tr align="center">
<td width="100%" colspan="2"> footer info</td>
</tr>
</table>
</div></center>
</body>
</html>


Where did I go wrong?

Quote Reply
Re: template hell. Please help. In reply to
Hi,

That is just because <&#37;category_clean&#37;> isn't a tag that is supposed to go on your main page.

This is the basic format of the main page......
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>

<head>
<title><%site_title%></title>
<meta name="description" content="put your description here">
<meta name="keywords" content="put your keywords here">
<link rel=stylesheet href="<%build_images_url%>/default/links.css" type="text/css" title="<%site_title%> style sheet">
</head>

<body>

<h1 class="home"><%site_title%></h1>

<%include header.txt%>

<p>Welcome to the Links online demo. Feel free to add your own link, modify another's or just play around!</p>

<h2>Categories:</h2>

<%category%>

<p class="grandtotal">There are <strong><%grand_total%></strong> links for you to choose from!</p>

<%include footer.txt%>
</body>
</html>
Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: template hell. Please help. In reply to
Paul, Thanks for your response. But, I don't see the use of <%category_clean%> in my code.

hmmmmm. Do you see it in the code I provided?

Quote Reply
Re: template hell. Please help. In reply to
Paul meant <%category_name%>, which you plainly do have and you CANNOT use this tag in the home.html file.

Regards,

Eliot Lee
Quote Reply
Re: template hell. Please help. In reply to
Oops yes sorry I meant _name not _clean.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: template hell. Please help. In reply to
hmmmm. I have <%category_name%> in the "header.txt" file.

Quote Reply
Re: template hell. Please help. In reply to
RIGHT...and you CANNOT use that! ONLY in the category.html file! The example I gave in other Thread you referred to was the category.html NOT the home.html!

Regards,

Eliot Lee
Quote Reply
Re: template hell. Please help. In reply to
Eliot. This is the html code YOU gave me in a previous thread to put in "header.txt" file.

Boy this is all frustrating.

Quote Reply
Re: template hell. Please help. In reply to
LOOK at the EXAMPLE I gave you AGAIN!

IT WAS FOR THE CATEGORY.HTML NOT ANY OTHER TEMPLATE FILES! Mad

Regards,

Eliot Lee
Quote Reply
Re: template hell. Please help. In reply to
Since you plainly glanced over the complete REPLY in the other Thread...here it is AGAIN:

In Reply To:

Editing TEMPLATES for any script (e.g., Active Server Pages, Cold Fusion, PHP, Phython, Perl, etc...) basically consists of understanding the "tag" syntax and then putting them within the HTML template file....

If you really want an example of what you need, here it goes:

<html>
<head>
<title><%site_title%>: <%category_name%></title>
<%if meta_description%>
<meta name="Description" content="<%meta_description%>">
<%endif%>
<%if meta_name%>
<meta name="Keywords" content="<%meta_name%">
<%endif%>
</head>
<body bgcolor="ffffff">
<div align="center"><center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr bgcolor="FFFFFF">
<td valign="top" width="50%">
MENU OPTIONS
</td>
<td valign="top" width="50%">
MORE STUFF
</td></tr>
<tr>
<td valign="top" width="100%" colspan="2">



<div align="center"><center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" width="80%">
<%if Body%>
<%Body%>
<%endif%>
<p>
OTHER STUFF
</td>
<td valign="top" width="20%">
<%if category%>
<%category%>
<%endif%>
<p>
Other stuff
</td></tr>
</table>
</div></center>



</td></tr>
<tr>
<td valign="top" width="100%" colspan="2">
FOOTER STUFF
</td></tr>
</table>
</div></center>
</body>
</html>

RED text = HEADER.TXT file
BLUE text = BODY of category.html file
GREEN text = FOOTER.TXT file

Regards,

Eliot Lee


Look at the BOLDED red CODES ---> category.html category.html category.html

Regards,

Eliot Lee
Quote Reply
Re: template hell. Please help. In reply to
Eliot.

The text in RED is to be put in the header.txt file. That's what you told me.

If I put the friggin text you wrote in RED in the header.txt file, it becomes a part of any file that is called. It becomes the header of ANY friggin document.

Now, I may have misunderstood something AGAIN... so, I will quote your text again. (And I may just request a refund on the product and figure another approach...this is becoming such a pain)

Eliot, your text:

<html>
<head>
<title><%site_title%>: <╩tegory_name%></title>
<%if meta_description%>
<meta name="Description" content="<%meta_description%>">
<%endif%>
<%if meta_name%>
<meta name="Keywords" content="<%meta_name%">
<%endif%>
</head>
<body bgcolor="ffffff">
<div align="center"><center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr bgcolor="FFFFFF">
<td valign="top" width="50%">
MENU OPTIONS
</td>
<td valign="top" width="50%">
MORE STUFF
</td></tr>
<tr>
<td valign="top" width="100%" colspan="2">




<div align="center"><center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" width="80%">
<%if Body%>
<%Body%>
<%endif%>
<p>
OTHER STUFF
</td>
<td valign="top" width="20%">
<%if category%>
<╩tegory%>
<%endif%>
<p>
Other stuff
</td></tr>
</table>
</div></center>




</td></tr>
<tr>
<td valign="top" width="100%" colspan="2">
FOOTER STUFF
</td></tr>
</table>
</div></center>
</body>
</html>




RED text = HEADER.TXT file
BLUE text = BODY of category.html file
GREEN text = FOOTER.TXT file

Quote Reply
Re: template hell. Please help. In reply to
UGH!

And look at how I qualified the example: AS AN EXAMPLE!

AND THEN LOOK AT THE FOLLOWING TEXT:

BODY of category.html file

And in an earlier REPLY in that SAME THREAD, I ALSO REFERED TO THE C A T E G O R Y. H T M L FILE!

Again, I WAS GIVING you an EXAMPLE of how to USE the TEMPLATE FILES! Which you are plainly NOT understanding!

May be others will help you...but I am done! Best of luck!

Regards,

Eliot Lee
Quote Reply
Re: template hell. Please help. In reply to
The example would be helpful if it worked in my application. It does not. So it doesn't show me an example of anything except that it doesn't work.

Thanks for trying Eliot. If you are half as frustrated as me, well then, I am sorry. This may be a simple concept... but I have worked with template systems for VBulletin that I haven't had trouble with.

I have heard fabulous things about GT as a company and this script as a product...but two weeks in I can't even figure out how to edit the header and footer templates! (And I aint stupid)

I will take this offline and talk with alex about it. Thanks for your time, Eliot and Paul

Quote Reply
Re: template hell. Please help. In reply to
Hi,

The reason it won't work is because the tag, although in the header file, still becomes part of the main page if it is included, just as it would become part of the category page if you used the header there. Therefore if you wish to use that tag in your category.html header then you will need to create a seperate header for home.html to get rid of the error. Does that make sense?

So you'd have <%header2%> in home.html without the category_name tag, but in category.html you'd have <%header%> that can include the category_name tag because that template won't produce an error.

Let me know if that makes sense to you or not.

So basically because some templates reject category_name and some do not, then you can't add it into the global header tag as it will produce errors on some templates. So on those templates you will need to make a different header without that tag.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: template hell. Please help. In reply to
Paul...It does make sense. I had figured out a similar solution throughout this discussion.

What I realized is to not put the actual html header in the header.txt, but rather leave it in each individual html file, and to put <%include header.txt%> right after the <body> tag in each html file.

So, thank you again.