ahughes3 Posted October 1, 2015 Report Share Posted October 1, 2015 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. Quote Link to comment Share on other sites More sharing options...
josh90 Posted October 2, 2015 Report Share Posted October 2, 2015 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 Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted October 2, 2015 Members Report Share Posted October 2, 2015 damn you beat me Quote Link to comment Share on other sites More sharing options...
ahughes3 Posted October 2, 2015 Author Report Share Posted October 2, 2015 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. Quote Link to comment Share on other sites More sharing options...
natcret Posted January 7, 2016 Report Share Posted January 7, 2016 Just a quick question: This was under profile main? Quote Link to comment Share on other sites More sharing options...
natcret Posted January 8, 2016 Report Share Posted January 8, 2016 Disregard, figured it out. Profile_main.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.