How to place holding text

7 posts by 3 authors in: Forums > CMS Builder
Last Post: March 13, 2013   (RSS)

By KCMedia - March 12, 2013

Hi

I have this piece of code

                                    <div class="list">
                                        <ul>
                                            <?php if($record['ra_1'] != "0") { ?>
                                            <li>
                                                <span>No Reviews Currently Avaliable</span>
                                            </li>
                                            <?php } ?>
                                            <?php if($record['ra_1'] != "") { ?>
                                            <li>
                                                <span><?php echo $record['ra_1']; ?></span>
                                            </li>
                                            <?php } ?>
                                            <?php if($record['ra_2'] != "") { ?>
                                            <li>
                                                <span><?php echo $record['ra_2']; ?></span>
                                            </li>
                                            <?php } ?>
                                            <?php if($record['ra_3'] != "") { ?>
                                            <li>
                                                <span><?php echo $record['ra_3']; ?></span>
                                            </li>
                                            <?php } ?>
                                        </ul>
                                    </div>

what i want to do is if there is nothing in the ra_1 field to display some text in its place how can i do this.

Thanks



Craig

KC Media Solutions

www.kcmedia.biz

By Codee - March 12, 2013

<?php if ($record['ra_1']): ?>
    <?php echo $record['ra_1'] ?>
        <?php else: ?> Send in your money<br/><br/>
<?php endif ?>

By KCMedia - March 13, 2013

Hi Equinox

thanks for that but i tried that and it didnt work for me either.

This is a detail page for a multi section

Thanks



Craig

KC Media Solutions

www.kcmedia.biz

By Dave - March 13, 2013

Hi kcmedia, 

Try this:

<div class="list">
  <ul>
    <?php if ($record['ra_1']): ?>
      <li><span><?php echo $record['ra_1']; ?></span></li>
    <?php else: ?>
      <li><span>No Reviews Currently Avaliable</span></li>
    <?php endif ?>
  
    <?php if ($record['ra_2']): ?>
      <li><span><?php echo $record['ra_2']; ?></span></li>
    <?php endif ?>
  
    <?php if ($record['ra_3']): ?>
      <li><span><?php echo $record['ra_3']; ?></span></li>
    <?php endif ?>
  <li>
</div>

And if that doesn't work, post the output of this: 

<?php showme($record); ?>

Let me know how it goes.

Dave Edis - Senior Developer
interactivetools.com

By KCMedia - March 13, 2013

Hi Dave

perfect thank you worked great.

Thanks



Craig

KC Media Solutions

www.kcmedia.biz

By Codee - March 13, 2013

doh! Dave had replied already. Sorry.