Results 1 to 5 of 5
-
01-09-2010, 06:50 PM #1
If the image is not on the image folder show "no image"
Hi.I need to show the images wich are in folder images & display "No Image" for those we have not the image in the folder.
I wrote this code:
<cfset PhotoLocation =
"e:\www\NeedBattery\images\manufacturer\<cfoutput> #getBrands.cat_level2_image#</cfoutput>">
<cfif not FileExists(PhotoLocation)>
<cfoutput>no image</cfoutput>
<cfelse>
<a><img src="#imagePath#images/manufacturer/#getBrands.cat_level2_image#" width="60" height="40" /></a>
</cfif>
but the result is incorrect & typed "NO Image" for all the images.
would u plz help me what is wrong with my code?
thanks
-
01-10-2010, 10:20 PM #2
- Join Date
- Sep 2009
- Posts
- 1,135
- Thanks
- 0
- Thanked 16 Times in 16 Posts
- Blog Entries
- 1
- Feedback Score
- 0
if you dont like that idea you can do this but im not sure as i would have to have a look at your variables more first
<cfif isdefined("#getBrands.cat_level2_image#")>
<a><img src="#imagePath#images/manufacturer#getBrands.cat_level2_image#" width="60" height="40" /></a>
<cfelse>
<p>"No image"</p>
</cfif>
hope this helps
-
01-31-2010, 10:37 AM #3
If you take the approach of a "missing image" like unitedlocalbands is explaining, then I would take it a step further and remove ColdFusion from the equation all together. This is something that can be handled 100% on the client side:
<img src="#yourimage#" width="60" height="40" onerror="this.src='/images/nologo.png';">
-
02-02-2011, 11:49 AM #4
I would put a description of what the image is, rather than just having the page display the words "No Image", it would greatly improve your SERP rankings.
-
11-30-2011, 12:09 PM #5
Banned
- Join Date
- Nov 2011
- Location
- USA
- Posts
- 12
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
yes nice images i like it and post new images i hope its also fantastic dear...
Similar Threads
-
Create High Quality Thumbnail - Resize Image Dynamically - ASP .Net C# Code
By manik in forum ASPReplies: 18Last Post: 03-03-2012, 11:39 PM -
Image Effects
By yawez.com in forum HTML / DHTMLReplies: 43Last Post: 12-04-2011, 11:41 AM -
Google image swirl
By mamedesign in forum GoogleReplies: 0Last Post: 02-22-2010, 09:52 PM




Reply With Quote

