Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Featured links on top/Different template

Quote Reply
Featured links on top/Different template
Hi,

I created a new field in the Links database called "Featured". options are Yes/No.

In my LSQL admin, I went to Setup/Build Options/build_sort_order_category

And changed them to: Featured DESC, Title

Which, I'd think would mean that it would list Featured items first, then sort by title. But, it doesn't work. Frown What am I doing wrong? Actually, what i';d like is for it to show the Featured items marked YES first, then show all others after that, sorted by title.

Second thing, is that I want to use a different template for the Featured items, so what I did was to create a copy of link.html and modifed it how I wanted, saved it as link_3.html. Then, within the category template, I went in and added this:

<%if Featured eq 'Yes'%>
<%loop links_loop%>
<%include link_3.html%>
<%endloop%>
<%else%>
<%loop links_loop%>
<%include link.html%>
<%endloop%>

But, I get no different template actioon. Am I using the wrong code to get the results I seek?

Thanks so much,
Evie
Quote Reply
Re: [Evoir] Featured links on top/Different template In reply to
Here is some more info on this topic, hope it helps:

http://gossamer-threads.com/...search_engine#263305

Robert
http://www.pcprofiles.com
PC Profiles and hardware reviews
Quote Reply
Re: [Robert_B] Featured links on top/Different template In reply to
Ahhh, yes. I had seen that thread and followed the instructions there. Unfortunately, it is not working for me. This is the first part that is not working:

<%if Priority eq 'Yes'%>
<%include link_priority.html%>
<%else%>
<%include link.html%>
<%endif%>

It's like it is not recognizing <%if Priority eq 'Yes'%>
Quote Reply
Re: [Evoir] Featured links on top/Different template In reply to
Try a couple of variations.

Bet

if Priority = "Yes"

or

if Priority = Yes

works.
Quote Reply
Re: [webslicer] Featured links on top/Different template In reply to
hmmm. I have tried a few things. (my names are different than above, am just copy and pasting here:)

<%if Featured = 'Yes'%>
<%loop links_loop%>
<%include link_3.html%>
<%endloop%>
<%else%>
<%loop links_loop%>
<%include link.html%>
<%endloop%>
<%endif%>

It seems like if I use = instead of eq I get every link using link_3.html template. Frown hmmmph.

It seems like I need the loops in there, cause when i don't have them, I get another error... am i using the right kind of loops?
Quote Reply
Re: [Evoir] Featured links on top/Different template In reply to
Hi Evoir

Here's a couple of things you can try:

<%loop links_loop%>
<%if Featured = 'Yes'%>
<%include link_3.html%>
<%endif%>
<%endloop%>

<%loop links_loop%>
<%include link.html%>
<%endloop%>

This 'should' display featured 1 st then standard display, which will also include the featured links.

You can also try and narrow down the problem by just keeping it simple to start.

<%if Featured = 'Yes'%>
featured <%title%>
<%else%>
not featured <%title%>
<%endif%>

PS I don't think you need to loop the link.html template. ???

Regards

minesite
Quote Reply
Re: [minesite] Featured links on top/Different template In reply to
Mel helped me with the answer. Here is what she said (and it worked!)

<%loop links_loop%> gets you all the links in that category. <%if Featured
eq 'Yes'%> is from inside the loop, so you need to do something like:

<%loop links_loop%>
<%if Featured eq 'Yes'%>
featured stuff
<%endif%>
<%endloop%>
Quote Reply
Re: [minesite] Featured links on top/Different template In reply to
In Reply To:
<%loop links_loop%>
<%if Featured = 'Yes'%>
<%include link_3.html%>
<%endif%>
<%endloop%>

<%loop links_loop%>
<%include link.html%>
<%endloop%>
This works except that on spanned pages instead of putting the featured at the beginning of all the links displayed(page 1), it puts the featured at the top of the page the link is on. I.E. - I'm displaying 10 links per page and I have 70 links. I have a featured link that starts with U, instead of putting the featured link on the first page it puts it on page 7 at the top(along with the regular(nonfeatured) version). Any ideas would be greatly appreciated.

PS I was using Top_5_Links plugin, but it was only listing the featured links once(as featured). I am trying to get them listed twice.Once as featured then also in the regular(nonfeatured) list