Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Conditional link based on image name.

Quote Reply
Conditional link based on image name.
Hello world!

I have just modified my database table so that I can choose an image from a scroll down menu that will appear next to a link. It’s some sort of thumbnail that explains the link a little bit.

I would like the thumbnail image that has been picked (when the record is first created) to link to the category that it represents. I don’t think creating another way of inputting every link when the record is created is the fastest way of doing things. I was thinking of using a conditional loop in the link.html template that would do something like this:

if image name is “image1”, then <a href=”link to category of image1”>
if image name is “image2”, then <a href=”link to category of image2”>
if image name is “image3”, then <a href=”link to category of image3”>

Etc, etc.

I can explain pretty well what I have in mind ,
but really that's is as far as I can go for the moment. I need some help in the coding!


Thank you for your time.
Quote Reply
Re: [nt6] Conditional link based on image name. In reply to
Hi. Hopefully I have the right idea of what you are asking Wink Tryusing;

Code:
<%if FieldName eq 'image1'%><img src="src toimage1"><%endif%>
<%if FieldName eq 'image2'%><img src="srcto image2"><%endif%>
<%if FieldName eq 'image3'%><imgsrc="src to image3"><%endif%>


Hope that helps Tongue

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!