Skip to main content
September 9, 2006
Answered

Help with Making image display conditional?

  • September 9, 2006
  • 1 reply
  • 389 views
I have developed a set of dynamic pages (php) that display examples of artists work, but have a problem with the display in IE browsers. Because the table is setup to carry a maximum of 4 images and associated alt text, IE displays an image holder in place of 'missing' images where the maximum number of images are not used.
To overcome this I would like to be able to make the page only display the number of images that are in the table, without displaying the extra image holders. I assume that this can be done with some kind of an IF..ELSE statement?????
The page in question is generated when an artist is selected from the List of Exhibitors. For example the Sue James listing uses only 2 images and the page therefore looks like it has broken images at the bottom of the listing because of the image place holders.
Any suggestions or pointers would be greatly appreciated.
Sorry if I haven't made myself sufficiently clear.
Thanks in advance,
Graham (more a potter than a developer )
This topic has been closed for replies.
Correct answer
Murray you are a champ!!
I went with your first suggestion because I found it easier to understand. Have tweaked it to suit the various table categories and it is working a treat on all sections - the artists, businesses and educational listings.
Thank you so much for your expert assistance - it is very greatly appreciated.
Graham

1 reply

Inspiring
September 9, 2006
<?php if(imagefield!='') { echo"<img src='imagefield'>"; } ?>

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"GrahamMercer" <webforumsuser@macromedia.com> wrote in message
news:edtf19$efm$1@forums.macromedia.com...
>I have developed a set of dynamic pages (php) that display examples of
>artists
> work, but have a problem with the display in IE browsers. Because the
> table is
> setup to carry a maximum of 4 images and associated alt text, IE displays
> an
> image holder in place of 'missing' images where the maximum number of
> images
> are not used.
> To overcome this I would like to be able to make the page only display the
> number of images that are in the table, without displaying the extra image
> holders. I assume that this can be done with some kind of an IF..ELSE
> statement?????
> The page in question is generated when an artist is selected from the
> http://potteryexpo.com/Fedsquare/fedsq-participants.php. For example the
> http://potteryexpo.com/Fedsquare/participant-details.php?recordID=18 uses
> only
> 2 images and the page therefore looks like it has broken images at the
> bottom
> of the listing because of the image place holders.
> Any suggestions or pointers would be greatly appreciated.
> Sorry if I haven't made myself sufficiently clear.
> Thanks in advance,
> Graham (more a potter than a developer )
>


September 10, 2006
Hi Murray, thanks for the quick response. Unfortunately due to my lack of skill with PHP I am not exactly sure how to implement your suggestion. Any chance you could expand a little on your answer please?
You said

<?php if(imagefield!='') { echo"<img src='imagefield'>"; } ?>

so how would I incorporate that into the example code below please so that the browser doesn't show an image placeholder if there is no image to display?

<p align="center" class="style1"><img src="images/variable/<?php echo $row_participant_details['image4']; ?>" alt="<?php echo $row_participant_details['image4 text']; ?>"></p>

Thanks again for your help,
Graham