Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Featured Link / Link Highlighting

Quote Reply
Featured Link / Link Highlighting
Good Afternoon!

I apologise for the newbyness of this question, and I would be grateful to anyone who responded. I have been looking over the forums and recourses but canít locate what Iím looking for. Iím trying to make some conversions to LinksSQL so that we can have featured links displayed in a different format to the rest (you all know the score, put it in its own small table with a shaded background so it stands out amongst the rest), but I canít seem to find how to do this or what plug-in I would need to download.

If anyone could give me some pointers to get me on my way it would make my life much easer, and then the boss would stop breathing down the back of my neck! Wink
Scampi.

-----------------------------------------------------
A Little Madness Now And Then,
Is Relished By The Wisest Men
- Mr Willy Wonka
-----------------------------------------------------
Quote Reply
Re: [Scampi] Featured Link / Link Highlighting In reply to
Hi, Scampi;

You do not need a plugin!

You can do this by adding in a column called (for example) "featured_link" to the Links database.

On the Admin menu, click/select
->Database
->Links/Properties, click "Go"
->click "Add Column"

Column Name: Featured_Link
Column Type: Text
Form Display: Featured Link
Form Type: Text
Form Size: 2

click "Add Field to Links"


You could make this "Yes" and "No", or 1 and 0.

Then, in the link.html template, you set it to look for the "featured_link flag.
If the flag is there, you put the link in with a box/table with a background color.
Other wise, not!

link.html

<%if featured_link%>
<!-- put the link in a shaded table -->
your featured code goes here

<else>
<!-- non featured link code goes below -->
your non-featured code goes here

<endif>


Then just put 1 or 0 in to make/not make the link featured.

Advanced...
You may have to put in
<%if featured_link = 'Yes'%>
if you use "Yes"/"No", which are Enumerated Types.
Quote Reply
Re: [webslicer] Featured Link / Link Highlighting In reply to
Don't forget to update the build_sort_order_category in Setup > Build Options. Add the Featured_Link bit in the front, so it looks something like;

Featured_Link,isNew DESC,isPopular DESC,Title

Hope that helps Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Featured Link / Link Highlighting In reply to
 
If you do Featured_Link DESC (Sorted by Descending Order) you can make Featured_Link to be from 1-10, 10 being the top slot on the page :)

And of course the link.html code needs to be changed...

<%if Featured_Link > 0 %>

it's featured...

<%else%>

not featured

<%endif%>
Quote Reply
Re: [Scampi] Featured Link / Link Highlighting In reply to
I took a different tack - after adding a priority field (as shown in previous comments, but my Priority is a integer between 0-9). I then added a CSS class to the table that encompasses each link (link.html) <table width=<%bodywidth5) class="priority<%priority%>" border=0>

Then I can modify the style sheet to style the table accordingly.

- Tom Ransom
hightechtraveler.com
Quote Reply
Re: [transom] Featured Link / Link Highlighting In reply to
That's an excellent solution, Transom!

I use an integer from 0-9 also as this lets us completely control the first 10 link positions.

But the CSS idea is very powerful. Could you kindly post your CSS code as an example so that it could be implemented?

I'm sure many non-CSS experts, myself included, would love to implement this!
Quote Reply
Re: [webslicer] Featured Link / Link Highlighting In reply to
I would hardly classify myself as CSS expert - But it let me do what I wanted quickly. On HighTechTraveler.com - I'll let a hotel purchase a priority link and get a highlighted link. You can see an example by going to <http://www.hightechtraveler.com/cgi-bin/search.cgi?Brand=RAM> - In the CSS file, I wanted a tinted background on the upgraded links. So the default link has a priority of 9 and the others are 1-8.
table.priority9 {
background-color: white
}

table.priority8 {
background-color: #fffaf0
}

table.priority7 {
background-color: #fffacd
}

YMMV and I may ultimately change how I handle this as I build out the e-commerce side of the site.

- Tom Ransom
Quote Reply
Re: [transom] Featured Link / Link Highlighting In reply to
Morning!

Thanks to anyone who posted a responce to my question, I was hoping that it could be done with CSS, but I wasn't sure how.

Thanks again!
Scampi.

-----------------------------------------------------
A Little Madness Now And Then,
Is Relished By The Wisest Men
- Mr Willy Wonka
-----------------------------------------------------