Answered
getting images to NOT appear when field in recordset is has content
On one of my site pages, i have the latest news being pulled
in, but i only want the latest news story pulled in if the image
field in tbNews contains text. if there is no image then i just
want 3 images (these can be hard coded) to be displayed.
DynamicImage is image being pulled in from the image field in tbNews. Image1, image2 and image3 are the images i wanted displayed if the image field in tbNews is empty. If the image field contains text then i do not want Image1, image2 and image3 to be displayed.
****CODE****
<div id="Video"> <img src="uploaded_images/files/news/<cfoutput>#rsLatestNews.image#</cfoutput>" alt="Latest News" name="DynamicImage" id="DynamicImage"> </a> <img src="images/dvdNoFlash.jpg" alt="other images" name="image1" width="87" height="92" id="image1" /><img src="images/dvdNoFlash.jpg" alt="other images" name="image2" width="87" height="92" id="image2" /><img src="images/dvdNoFlash.jpg" alt="other images" name="image3" width="87" height="92" id="image3" /> </div>
RECORDSET:
<cfquery name="rsLatestNews" datasource="DSNGrid">
SELECT *
FROM tbNews
ORDER BY newsDate DESC
the structure for tbNews
newsID
newsDate
newsSubject
newsStory
image
Hope im making sense,
Does anyone know how i achieve this?
DynamicImage is image being pulled in from the image field in tbNews. Image1, image2 and image3 are the images i wanted displayed if the image field in tbNews is empty. If the image field contains text then i do not want Image1, image2 and image3 to be displayed.
****CODE****
<div id="Video"> <img src="uploaded_images/files/news/<cfoutput>#rsLatestNews.image#</cfoutput>" alt="Latest News" name="DynamicImage" id="DynamicImage"> </a> <img src="images/dvdNoFlash.jpg" alt="other images" name="image1" width="87" height="92" id="image1" /><img src="images/dvdNoFlash.jpg" alt="other images" name="image2" width="87" height="92" id="image2" /><img src="images/dvdNoFlash.jpg" alt="other images" name="image3" width="87" height="92" id="image3" /> </div>
RECORDSET:
<cfquery name="rsLatestNews" datasource="DSNGrid">
SELECT *
FROM tbNews
ORDER BY newsDate DESC
the structure for tbNews
newsID
newsDate
newsSubject
newsStory
image
Hope im making sense,
Does anyone know how i achieve this?