Jump to content

Awards images showing but name & description not


ahughes3

Recommended Posts

Hi all,

I am trying to get my pilot's awards to show on their Pilot Centre page. This is the code I am using which is pretty much the standard built into phpvms. The award images show just fine, but for some reason the name and description won't.

<div class="inner-content-box">
    <ul class="icons-list">
  <?php
  if(!$allawards) {
   echo '<li><i class="fa fa-trophy icon-large"></i> No awards yet</li>';
  } else {

   /* To show the image:
 <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />
   */

  ?>
	 </ul>
  <ul class="icons-list">
   <?php foreach($allawards as $award){ ?>
   <li><img src="<?php echo $award->image?>" alt="<?php echo $award->name ?> - <?php echo $award->descrip?>" /></li>
   <?php } ?>


  </ul>
  <?php
  }
  ?>
	 </div>

Any ideas anyone? I've tried various combinations of coding but the name and description just never show up.

Link to comment
Share on other sites

Hi all,

I am trying to get my pilot's awards to show on their Pilot Centre page. This is the code I am using which is pretty much the standard built into phpvms. The award images show just fine, but for some reason the name and description won't.

<div class="inner-content-box">
 <ul class="icons-list">
<?php
if(!$allawards) {
echo '<li><i class="fa fa-trophy icon-large"></i> No awards yet</li>';
} else {

/* To show the image:
 <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />
*/

?>
	 </ul>
<ul class="icons-list">
<?php foreach($allawards as $award){ ?>
<li><img src="<?php echo $award->image?>" alt="<?php echo $award->name ?> - <?php echo $award->descrip?>" /></li>
<?php } ?>


</ul>
<?php
}
?>
	 </div>

Any ideas anyone? I've tried various combinations of coding but the name and description just never show up.

Hi Harry,

Hope you're well. Based on your current code, the only time the name and description will display is if there's a problem displaying the image, as the name and description are being used as a textual alternative using the "alt" attribute. If you wish to display the name and image, you'll have to "echo" these too.

Try replacing your code with (notice the addition on line 17):

<div class="inner-content-box">
 <ul class="icons-list">
<?php
if(!$allawards) {
echo '<li><i class="fa fa-trophy icon-large"></i> No awards yet</li>';
} else {

/* To show the image:
 <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />
*/

?>
	 </ul>
<ul class="icons-list">
<?php foreach($allawards as $award){ ?>
<li><img src="<?php echo $award->image?>" alt="<?php echo $award->name ?> - <?php echo $award->descrip?>" />
<?php echo $award->name ?> - <?php echo $award->descrip?></li>
<?php } ?>


</ul>
<?php
}
?>
	 </div>

Hope this helps

Josh

Link to comment
Share on other sites

Aah nuts, d'ya know what...................I stared at the "alt" bit for ages thinking.........."I'm sure it's staring me in the face" and I didn't even cotton on. <_<

Thanks guys as always, showing up lovely now. Now I just need to work out how to get the table inside the div to wrap the text instead of running on outside the div. :wacko:

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...