Jump to content

Need help making a blockquote and line items conditional


drums

Recommended Posts

I have some code I bought a few years ago that allows my clients to update content on their site using an Excel spreadsheet. Well this particular application sometimes has line items so I need to come up with a way to do this since it didn't like the fact I put the tags in the echo statement.

<?php echo <h2> $record['header1']; </h2> ?>
<?php echo <p> $record['para1']; </p> ?>
<blockquote><?php echo <li> $record['bullet1']; </li> ?>
          <li><?php echo $record['bullet1-2']; </li> ?>
            <?php echo <li> $record['bullet1-3']; </li> ?>
            <?php echo <li> $record['bullet1-4']; </li> ?>
            <?php echo <li> $record['bullet1-5']; </li> ?>
            <?php echo <li> $record['bullet1-6']; </li> ?>
            <?php echo <li> $record['bullet1-7']; </li> ?>
    </blockquote>
<?php echo <p> $record['para1-end']; </p> ?> 

So I took them out but I'm stuck with having bullet points when I don't want them.

<h2><?php echo $record['header1']; ?></h2>
<p><?php echo $record['para1']; ?></p>
<blockquote><li><?php echo $record['bullet1']; ?></li>
          <li><?php echo $record['bullet1-2']; ?></li>
            <li><?php echo $record['bullet1-3']; ?></li>
            <li><?php echo $record['bullet1-4']; ?></li>
            <li><?php echo $record['bullet1-5']; ?></li>
            <li><?php echo $record['bullet1-6']; ?></li>
            <li><?php echo $record['bullet1-7']; ?></li>
    </blockquote>
<p><?php echo $record['para1-end']; ?></p> 

 

Can someone help me add the condition where if there is no data the bullet point doesn't display?

(please ignore my non-compliant code using blockquote instead of UL)

 

Thanks very much for your time!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.