
Donna
Staff
/ Moderator

Sep 15, 2008, 11:22 AM
Post #4 of 5
(2131 views)
Shortcut
|
|
Re: [GloriaI] Adding image file to listing manager form
[In reply to]
|
Can't Post
|
|
Hi Brenda! No problem. Here's how you can set that up: First, upload all of your images to a known location, and take note of the file names & the path to your images. Next, add a new dropdown field to Listings Manager like this: Descriptive Image (,sold,leased,updated) ...where "sold", "leased" and "updated" are the filenames (minus the extension if they're all the same -- but include the extension if they have different ones. But if it's all ".png" or all ".jpg" or something else, you can leave it out.) Take note of what field this is in (ie, lfield20) Next, add the following code to your template: <script type="text/javascript"> if ('$lfield20$') { document.write("<img src='/path/to/$lfield20$.jpg'>"); } </script> ...where "$lfield20$" is the field you created for that dropdown field, and the /path/to/ is the file path on your server to where you uploaded the images. We've also set this up in a conditional javascript so that it only appears if there's something in the field. An alternative method would be to upload an image called "none.jpg" that is just a 1x1 pixel blank image, and change the field to: Descriptive Image (none,sold,leased,updated) And the template code to: <img src="/path/to/$lfield20$.jpg"> This will default the image to "none", and so any image that doesn't have anything selected will only display the 1x1 pixel image (that nobody would really see.) The catch with this is that you would need to go back through any of your previous listings and manually select "none" (or any of the other options) or they won't have anything assigned and will show a broken image link. I hope this helps! Let me know if you have any questions or concerns. :) Donna -- support@interactivetools.com
|