Gossamer Forum
Home : Products : Links 2.0 : Customization :

Templates in tables problem.

Quote Reply
Templates in tables problem.
I have created some custom templates for use with Links 2. However i find that none of my links actually display. I seem to have traced this to a problem where, if my Category.html page uses tables to hold the fileds they do not display, but if they are outside the table they are fine. Also standard templates work fine so i guess my overall setup is fine.

Any help appreciated.

Thanks

Keith
Quote Reply
Re: [bage] Templates in tables problem. In reply to
Did you include this in your template: <%links%>
That is what calls them from the script.

Is your problem with links to Categories, or the off-site links?The appearance of the Category links is determined in site_html_templates.pl, in the last sub (sub site_html_print_cat). The appearance of the off-site links is determined by the link.html template.

If you need more help, you can attach your file here (category.html), and I'll look it over.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Templates in tables problem. In reply to
HI Leonard,

Yeah i have %lniks% included i believe (i'm no expert), The categoroies seem to work fine but the off site links don't. The strange thing is if it's inside a cell it doesn't work but outside the cell it does. I've been concentrating on this issue but think i also have a problem with the search function which may also be the dsame problem of being inside a table cell. I'll include below the html for a template that works and one that doesn't. If you can please take a look and let me know what i'm doing wrong (probably something dumb). Thanks for taking the time to look and respond.

Keith

This template works fine

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/...EC-html40/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title><%site_title%>: <%category_name%></title>
<%if meta_name%>
<meta name="description" content="<%meta_name%>">
<%endif%>
<if meta_keywords%>
<meta name="keywords" content="<%meta_keywords%>">
<%endif%>
<link href="../../../../css/basic.css" rel="stylesheet" type="text/css" media="all">
</head>

<body bgcolor="#f0f5fa" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" background="/images/titlebar1px.gif">
<tr height="38">
<td width="31%" height="38" background="../../web-content/images/titlebar1px.gif"></td>
<th valign="top" nowrap="nowrap" width="485" height="38"><img src="/images/logo.gif" alt="" width="185" height="69" border="0" /><img src="/images/one-name.gif" alt="" width="300" height="69" border="0" /></th>
<td width="31%" height="38" background="../../web-content/images/titlebar1px.gif"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" background="/images/subbar1px.gif" height="24">
<tr>
<td nowrap="nowrap">
<div align="center">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a title="Home Page" href="http://www.bage.org.uk" target="_self">Home</a> | <a title="Surname Origins" href="/origins.html" target="_self">BAGE Origins</a> | <a title="Family Trees" href="http://www.allthatrocks.co.uk/phpgedview/" target="_self">Family Trees</a> | <a title="Forums" href="http://www.allthatrocks.co.uk/forums/" target="_self">Forum</a> | <a title="Guestbook" href="http://www.allthatrocks.co.uk/...5fac&showforum=3" target="_self">Guestbook</a> | <a title="E-Mail Me" href="mailto:keith@bage.org.uk?subject=BAGE, Bage One-Name Study">E-Mail</a> </font></div>
</td>
</tr>
</table>
<div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="800" border="0" cellspacing="0" cellpadding="0" align="center" height="100">
<tr valign="top" height="100%">
<td align="left" valign="top" width="811" height="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><br>
</td>
</tr>
<tr>
<td>
<div align="center"></div>
<div align="left">
<html>
<body bgcolor="#333333" text="#000000">
<table width="100%" border="0" height="31">
<tr>
<td class="windowbg2" height="22">
<div align="center"></div>
</td>
</tr>
<tr>
<td class="windowbg2" height="22">
<div align="center">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="<%build_root_url%>">Link Home</a> | <a href="<%db_cgi_url%>/add.cgi">Add a Link</a> | <a href="<%db_cgi_url%>/modify.cgi">Modify a Link</a> | <a href="<%build_root_url%>/New">What's new</a> | <a href="<%build_root_url%>/Cool">What's Cool</a> | <a href="<%build_root_url%>/Ratings">Top Rated</a> | <a href="<%db_cgi_url%>/subscribe.cgi">Email Updates</a> | <a href="<%db_cgi_url%>/jump.cgi?ID=random">Random Links</a></font></div>
</td>
</tr>
</table>
<table width="99%" border="0">
<tr>
<td height="15"></td>
</tr>
</table>
</body>
</html>
<p></p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<p><strong class="title"><%title_linked%></strong></p>
</div>
<h2><%site_title%>: <%category_clean%></h2>
<!-- Subcategories--><%if category%>
<h3>Categories:</h3>
<%category%>
<%endif%>
<!-- Links in this category. -->
<%if links%>
<h3>Links: </h3>
<%links%>
<%endif%>
<!-- Next/Previous links if spanning pages. -->
<p align=center>
<%if prev%>
<small><a href="<%prev%>">Prev <%build_links_per_page%></a></small>
<%endif%>
<%if next%>
<small><a href="<%next%>">Next <%build_links_per_page%></a></small>
<%endif%>
</p>

<!-- Related Categories -->
<%if related%>
<h3>Related Categories:</h3>
<ul><%related%></ul>
<%endif%>
<!-- Search Bar -->
<form action="<%db_cgi_url%>/search.cgi" method="GET">
<h3>Search</h3>
<div class="margin">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td><strong class="search">Looking for something in particular?</strong></td></tr>
<tr><td><input type="text" size=15 name="query"> <input type=submit value="Search!"></td></tr>
<tr><td><small class="more"><a href="<%db_cgi_url%>/search.cgi">More search options</a></small></td></tr>
</table>
</div>
</form>
<p><small class="update">Pages Updated On: <%date%> - <%time%><br> </font>
</small></p>
<table width="100%" border="0" cellspacing="15" cellpadding="0">
<tr>
<td align="center" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a title="Home Page" href="http://www.bage.org.uk" target="_self">Home</a> | <a title="Surname Origins" href="/origins.html" target="_self">BAGE Origins</a> | <a title="Family Trees" href="http://www.allthatrocks.co.uk/phpgedview/" target="_self">Family Trees</a> | <a title="Forums" href="http://www.allthatrocks.co.uk/forums/" target="_self">Forum</a> | <a title="Guestbook" href="http://www.allthatrocks.co.uk/...5fac&showforum=3" target="_self">Guestbook</a> | <a title="E-Mail Me" href="mailto:keith@bage.org.uk?subject=BAGE, Bage One-Name Study">E-Mail</a></font></td>
</tr>
<tr>
<td align="center" valign="top"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">This page may be freely linked to but not duplicated in any fashion, wholly or in part, except for private study.??<br>
? 2000-2005 </font><a title="E-mail me" href="mailto:keith@bage.org.uk?subject=BAGE, Bage One-Name Study"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">Keith Bage</font></a>
<p><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.one-name.org">Guild Of One Name Studies</a> memebr # <a href="http://www.one-name.org/cgibin/search.cgi?find=4451">4451</a></font></p>
</td>
</tr>
<tr align="right" valign="top">
<td align="center" valign="top"><img align="top" border="0" src="/images/LegB400x40.gif"></td>
</tr>
</table>
</body>
</html>


This template does not show links.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/...ml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>BAGE - One Name Study</title>
<link href="../../../../css/basic.css" rel="stylesheet" type="text/css" media="all" />
<meta name="author" content="Keith Bage" />
<meta name="copyright" content="Keith Bage" />
<meta name="keywords" content="BAGE
Bage
bage
baige
family history
genealogy
one name study
ancestry
BMD
births
marriages
deaths
birth
marriage
death" />
<meta name="abstract" content="A one name study into the surname of BAGE. The aim of the study is to document all pedigrees for the name, gether staistics and to be a research aid to any one else researching the name BAGE." />
</head>

<body bgcolor="#f0f5fa" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" background="../../../../images/titlebar1px.gif">
<tr height="38">
<td width="31%" height="38" background="../../web-content/images/titlebar1px.gif"></td>
<th valign="top" nowrap="nowrap" width="485" height="38"><img src="../../../../images/logo.gif" alt="" width="185" height="69" border="0" /><img src="../../../../images/one-name.gif" alt="" width="300" height="69" border="0" /></th>
<td width="31%" height="38" background="../../web-content/images/titlebar1px.gif"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" background="../../../../images/subbar1px.gif" height="24">
<tr>
<td nowrap="nowrap">
<div align="center">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a title="Home Page" href="http://www.bage.org.uk" target="_self">Home</a> | <a title="Surname Origins" href="/origins.html" target="_self">BAGE Origins</a> | <a title="Family Trees" href="http://www.allthatrocks.co.uk/phpgedview/" target="_self">Family Trees</a> | <a title="Forums" href="http://www.allthatrocks.co.uk/forums/" target="_self">Forum</a> | <a title="Guestbook" href="http://www.allthatrocks.co.uk/...5fac&showforum=3" target="_self">Guestbook</a> | <a title="E-Mail Me" href="mailto:keith@bage.org.uk?subject=BAGE, Bage One-Name Study">E-Mail</a> </font></div>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="650" border="0" cellspacing="0" cellpadding="0" align="center" height="100%">
<tr valign="top" height="100%">
<td align="left" valign="top" width="811" height="100%">
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><br />
</td>
</tr>
<tr>
<td>
<div align="center">
</div>
<div align="left">

<html>

<body bgcolor="#333333" text="#000000">
<table width="100%" border="0" height="31">
<tr>
<td class="windowbg2" height="22">
<div align="center"></div>
</td>
</tr>
<tr>
<td class="windowbg2" height="22">
<div align="center">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="<%build_root_url%>"> Link
Home</a> | <a href="<%db_cgi_url%>/add.cgi">Add a Link</a> | <a href="<%db_cgi_url%>/modify.cgi">Modify
a Link</a> | <a href="<%build_root_url%>/New">What's new</a> | <a href="<%build_root_url%>/Cool">What's
Cool</a> | <a href="<%build_root_url%>/Ratings">Top Rated</a> | <a href="<%db_cgi_url%>/subscribe.cgi">Email
Updates</a> | <a href="<%db_cgi_url%>/jump.cgi?ID=random">Random Links</a></font></div>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="10">
<tr height="235">
<td width="172" height="235" valign="top" align=justify bordercolor="#ffffff" border: 4px >
<table width="171" border="0" cellspacing="0" cellpadding="0">
<tr valign="middle" align="left">
<td class="titlebg" colspan="3" height="18"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>
New Links</b></font></td>
</tr>
<tr>
<td class="windowbg2"><font size="1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><%lastlink%></font></font></td>
</tr>
</table>
<br>
<table width="171" border="0" cellspacing="0" cellpadding="0">
<tr valign="middle" align="left">
<td class="titlebg" colspan="3" height="18"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>
Search</b></font></td>
</tr>
<tr>
<td class="windowbg2">
<form action="<%db_cgi_url%>/search.cgi" method="GET">
<br>
<table border="0" cellspacing="1" cellpadding="3">
<tr>
<td><input bgcolor="#FFFFFF" type="text" size=10 name="query2" class="search"></td>
</tr>
<tr>
<td><input type=submit value="Search!" name="submit2" class=button></td>
</tr>
<tr>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="<%db_cgi_url%>/search.cgi" class="smallgrey">More
search options</a></font></td>
</tr>
</table>
<p> </p>
</form>
</td>
</tr>
</table>
</td>
<td valign="top" height="235" width="765">
<table width="565" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="563">
<table width="563" border="0" cellspacing="0" cellpadding="0" bgcolor="#f0f5fa">
<tr class="catbg2">
<td width="100%" height="18" class="titlebg"><%category_clean%></td>
</tr>
<tr bgcolor="#808080">

</tr>
<tr>
<td bgcolor="#F0F5FA" class="windowbg2"><!-- Subcategories--><%if category%>
<h2>Categories:</h2>
<%category%><%endif%><!-- Links in this category. --><%if links%>
<h2>Links:</h2>
<%links%><%endif%><!-- Next/Previous links if spanning pages. -->
<p align="center"><%if prev%><small><a href="<%prev%>">Prev <%build_links_per_page%></a></small><%endif%><%if next%><small><a href="<%next%>">Next <%build_links_per_page%></a></small><%endif%></p>
<!-- Related Categories --><%if related%>
<h2>Related Categories:</h2>
<ul>
<%related%>
</ul>
<%endif%><!-- Search Bar --></td>
</tr>
</table>
</td>
</tr>
</table>
<font size="1" color="black" face="Verdana, Arial, Helvetica, sans-serif" >Pages Updated On:
<%date%>
-
<%time%></font></td>
</tr>
<tr>
<td height="3" width="172"><img height="1" width="157" src="../../../../images/spacer.gif"></td>
<td width="765"></td>
</tr>
</table>
<table width="99%" border="0">
<tr>
<td height="15"></td>
</tr>
</table>
</body>

</html>

<p></p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="15" cellpadding="0">
<tr>
<td align="center" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a title="Home Page" href="http://www.bage.org.uk" target="_self">Home</a> | <a title="Surname Origins" href="/origins.html" target="_self">BAGE Origins</a> | <a title="Family Trees" href="http://www.allthatrocks.co.uk/phpgedview/" target="_self">Family Trees</a> | <a title="Forums" href="http://www.allthatrocks.co.uk/forums/" target="_self">Forum</a> | <a title="Guestbook" href="http://www.allthatrocks.co.uk/...5fac&showforum=3" target="_self">Guestbook</a> | <a title="E-Mail Me" href="mailto:keith@bage.org.uk?subject=BAGE, Bage One-Name Study">E-Mail</a></font></td>
</tr>
<tr>
<td align="center" valign="top"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">This page may be freely linked to but not duplicated in any fashion, wholly or in part, except for private study.??<br />
? 2000-2005 </font><a title="E-mail me" href="mailto:keith@bage.org.uk?subject=BAGE, Bage One-Name Study"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">Keith Bage</font></a>
<p><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.one-name.org">Guild Of One Name Studies</a> memebr # <a href="http://www.one-name.org/cgibin/search.cgi?find=4451">4451</a></font></p>
</td>
</tr>
<tr align="right" valign="top">
<td align="center" valign="top"><img align="top" border="0" src="/images/LegB400x40.gif" /></td>
</tr>
</table>
<p></p>
</body>

</html>
Quote Reply
Re: [bage] Templates in tables problem. In reply to
It would be better to attach the files next time, instead of pasting them into the post.

Looks like your problem is on this line:

<%category%><%endif%><!-- Links in this category. --><%if links%>
<h2>Links:</h2>

Unless you update the template.pm file, each if/endif must be on a new line:

<%category%>
<%endif%>
<!-- Links in this category. -->
<%if links%>
<h2>Links:</h2>

This is my first guess, and would certainly be the easiest fix. Change your template as shown above, and see if that takes care of it.

The only reason tables would make a difference is if you're breaking the code into jumbled chunks, which is easy enough to do when using templates. Let me know if you still need help, I'll look closer...


Leonard
aka PerlFlunkie