Dusty
asked on
CFML question/problem with using cfdirectory
This should be simple, and I'm sure it is :) What I'm trying to accomplish is output a query of similar homes with photo, and if the property does not yet have a photo, display the no-photo.png graphic instead of a broken photo link.
========================== ========== ========== ========== ========== ==
<cfoutput query="similarhomes">
<cfif similarhomes.RecordCount EQ 0 OR similarhomes.subdivision IS "none"><cfelse>
<a href="/#urlencodedformat(t rim(ListID ))#/#StrNu mber#-#Str Name#-#Cty #-#St#.htm l" target="_blank">
<cfdirectory action="list" directory="#ExpandPath('/f tp/pics/') #" filter="#variables.IDnumbe r#.jpg" name="similarpics">
<cfif similarpics.recordCount eq 0><img src="/images/no-photo.png" height="90" alt="no-photo" class="left" /><cfelse>
<img src="/ftp/pics/#ListID#.jp g" alt="#StreetNumber# #StreetName# #City# GA" width="130" height="90" class="left" /></cfif>
<h4>#StreetNumber# #StreetName#</a>
<br />
#City#, #State#</h4>
<br />
Price: #RemoveChars(DollarFormat( Price),Len (DollarFor mat(Price) )-3,3)#
<br />
SqFt: #TotalFinishedSQFT#
<br />
Bedrooms: #Bedrooms#
<br /><br />
<hr />
</cfif>
</cfoutput>
========================== ========== ========== ========== ========
An example page where I'm running this code is at:http://199.73.57.154/103862/306-Estates-Way-Warner-Robins-GA.html the photos show up on the right column under "Similar Homes" the code above works as long as there is an existing photo, but still just shows a broken photo link if there is no photo.
As always, any help is greatly appreciated!
==========================
<cfoutput query="similarhomes">
<cfif similarhomes.RecordCount EQ 0 OR similarhomes.subdivision IS "none"><cfelse>
<a href="/#urlencodedformat(t
<cfdirectory action="list" directory="#ExpandPath('/f
<cfif similarpics.recordCount eq 0><img src="/images/no-photo.png"
<img src="/ftp/pics/#ListID#.jp
<h4>#StreetNumber# #StreetName#</a>
<br />
#City#, #State#</h4>
<br />
Price: #RemoveChars(DollarFormat(
<br />
SqFt: #TotalFinishedSQFT#
<br />
Bedrooms: #Bedrooms#
<br /><br />
<hr />
</cfif>
</cfoutput>
==========================
An example page where I'm running this code is at:http://199.73.57.154/103862/306-Estates-Way-Warner-Robins-GA.html the photos show up on the right column under "Similar Homes" the code above works as long as there is an existing photo, but still just shows a broken photo link if there is no photo.
As always, any help is greatly appreciated!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER