Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help with Making image display conditional?

Guest
Sep 08, 2006 Sep 08, 2006
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 )
TOPICS
Server side applications
390
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Sep 09, 2006 Sep 09, 2006
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
Translate
LEGEND ,
Sep 09, 2006 Sep 09, 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 )
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 09, 2006 Sep 09, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 09, 2006 Sep 09, 2006
<p align="center" class="style1"><?php if
($row_participant_details['image4']!='') { ?>
<img src="images/variable/<?php echo $row_participant_details['image4']; ?>"
alt="<?php echo
$row_participant_details['image4 text']; ?>"><?php } ?></p>

or you could do this -

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

The former may be a bit easier to follow. Pay attention to the single and
double quotes in the latter.


--
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:edvm8r$s7o$1@forums.macromedia.com...
> 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
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 09, 2006 Sep 09, 2006
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 10, 2006 Sep 10, 2006
LATEST
I wish I could claim that this one was advanced PHP. Unfortunately, it's on
page 3 of the manual! 8)

--
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:ee01je$9q2$1@forums.macromedia.com...
> 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
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines