Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Show Link on all Spanned Pages

Quote Reply
Show Link on all Spanned Pages
I currently have an IsFeatured column in my Links table. Currently I have things set up so that isFeatured DESC is the first sort criterion. I then have category.html show Featured Links under a "Featured Links" heading if the link is Featured. So what happens is that all Featured Links in a category are forced to the first page of a category, and then the rest of the links (non-featured) show under and on spanned pages.

Is there a way that I can have the Featured Links show up on all spanned pages? This is my main desire. Secondly, is there a way to have the Featured Links also show up as regular links? If I could do this, I wouldn't need to use IsFeatured as the sort order (essentially a workaround so all Featured Links show on the first page).

Here is what I have in category.html:

Code:

<%if links_loop.length~%>
<h3>Featured Links <span class="small_txt_black">(<a href="http://www.WiredBIZ.com/advertising.html">Feature My Link</a>)</span></h3>
<%loop links_loop~%>
<%if ExpiryDate != 2147483647 or isFeatured eq 'Yes'%>
<%include link.html%>
<%endif%>
<%~endloop%>


And here is the regular loop:

Code:
<%if links_loop.length~%>
<%set header_printed = ""%>
<%loop links_loop~%>
<%if ExpiryDate = 2147483647 and isFeatured eq 'No'%>
<%unless header_printed%>
<h3>Links</h3>
<%if paging.num_hits%><div class="paging" align="right"><%Links::Utils::paging()%></div><%endif%>
<%set header_printed = 1%>
<%endif%>
<%include link.html%>
<%endif%>
<%~endloop%>
<%if paging.num_hits%><div class="paging" align="right"><%Links::Utils::paging(button_id => 'paging_button2')%></div><%endif%>
<%~endif%>


Now I realize that if I remove the "<%if ExpiryDate = 2147483647 and isFeatured eq 'No'%>" command from the regular call, it will show all links again. However, they will be shown in the sort order, as opposed to alphabetically, becuase I have had to force the sort of Featured Links to ensure they are first.
Quote Reply
Re: [Jobu] Show Link on all Spanned Pages In reply to
Why not just sort normally, and create a global which fetches your featured links and you can display them above the normal links. So the templates would be something like:
<%featuredlinks()%>
<%loop featured_links%>
...
<%endloop%>
[normal link loop]

Adrian
Quote Reply
Re: [brewt] Show Link on all Spanned Pages In reply to
That would be ideal... how would I fetch the featured links, i.e., what would the global be? Remember, I need to show featured links within each category, not just a list of all featured links in the DB.

Thanks!

EDIT - A ha! Found the answer here. Thanks for the help! http://www.gossamer-threads.com/...red%20global;#248312

Last edited by:

Jobu: Jul 23, 2006, 12:46 PM