Gossamer Forum
Home : Products : Gossamer Links : Discussions :

featured links within a table

Quote Reply
featured links within a table
I have read through all the posts I can find about featured links and I have it working just fine. However, I would like my featured links (up to 3 per category) appear in table with a colored border and a colored header. When I try this, with more than 1 featured link, the whole table repeats for each link. Example:

Featured link header
here is the link - and the description
Featured link header
here is link 2 - and the description
Featured link header
here is link 3 - and the description

What I would like is this:

Featured link header
here is the link - and the description
here is link 2 - and the description
here is link 3 - and the description

If that makes sense, does anyone have any suggestions how to accomplish this. I can see that the <%if isFeatured>0%> tag starts the creation of the whole table, and thus the repitition of the table. I just want to figure out a way around this and haven't yet.

Thanks in advance.

Lennie
Quote Reply
Re: [lennie] featured links within a table In reply to
Hi,

Hmm, it wouldn't be easy. You could try:

Code:
<%if isFeatured%>
<%ifnot start_table%>
<%set start_table = 1%>
<table header here..
<%endif%>
... regular featured link here
<%else%>
<%if start_table%>
<end table here..
<%set start_table = 0%>
<%endif%>
... regular link here
<%endif%>


Let me know if that works..

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] featured links within a table In reply to
Hi Alex, thanks for the response but I'm not sure what you mean by
<%if isFeatured%>
<%ifnot start_table%>
<%set start_table = 1%>
<table header here..
<%endif%>
... regular featured link here
<%else%>
<%if start_table%>
<end table here..
<%set start_table = 0%>
<%endif%>
... regular link here
<%endif%>

Do I add a links column as start_table with variables being 1 and 0?

Here is how my featured link code is now:

<%if isFeatured>0%> <table width="100%" border="0" cellspacing="0" cellpadding="1" bordercolor="#000066" bgcolor="#000066">
<tr>
<td>
<div align="left"><font face="Palatino" size="3"><b><font color="#FFFFFF">&nbsp; Webmaster's
Choice!</font></b></font><br>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="3%" valign="top">
<div align="right"><font face="arial" size="-1"><b>&#149&nbsp;</b></font></div>
</td>
<td width="97%"><%body_font%><a class="category_links" target="_blank" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>
<%if isNew%>
&nbsp;
<font color=red>
<small><sup>new</sup></small>
</font>
<%endif%>

<%if isChanged%>
&nbsp;
<font color=red>
<small><sup>updated</sup></small>
</font>
<%endif%>

<%if isPopular%>
&nbsp;
<small><font color="#6699cc">
<sup class="pop">pop</sup></font></small>

<%endif%>


<%if Description%>
<%body_font%> - <%Description%><br>
<%endif%>

<%if isLinkOwner%>
&nbsp;<%body_font%>
<small><a href="<%db_cgi_url%>/modify.cgi?LinkID=<%ID%>">
Edit this link</a></small>
<%endif%></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<%else%>
then my regular links are here (also build within a table)

I have tried making my isFeatured links column values 1, 2, and 3 and inserting a <%if isFeatured=2%> (and <%if isFeatured=3%>) before the inside table inside table with my first tag as <%if isFeatured=1%> in an attempt to force the building of the table only once. Almost worked the table built fine with featured link 1, but featured link 2 was outside the parent table. I even tried setting a <%loop%> inside the parent table, also to no avail . . . Does that make sense?

Thanks for help,

Lennie
Quote Reply
Re: [lennie] featured links within a table In reply to
Quote:
I have tried making my isFeatured links column values 1, 2, and 3 and inserting a <%if isFeatured=2%> (and <%if isFeatured=3%>) before the inside table inside table with my first tag as <%if isFeatured=1%> in an attempt to force the building of the table only once. Almost worked the table built fine with featured link 1, but featured link 2 was outside the parent table.


Actually, that sounds like a better idea. Make your template look like:

<%if isFeatured == 1%>
start table
<%endif%>
... regular link html here
<%if isFeatured == 3%>
end table
<%endif%>

and it should work.

Cheers,

Alex
--
Gossamer Threads Inc.