Re: [gagester] "Linking" style with list of services (which functions as buttons)
Hi gagester,
I'm not sure what you mean by embedding, but I did take a look at your code and I think I figured out what you're trying to accomplish.
All the HTML (and PHP) between the
foreach and
endforeach will be repeated, so if you want each service to appear in a <div id="bttn">, you'll want to put that <div> inside the foreach block. For example:
<?php foreach ($servicesRecords as $record): ?>
<div id="bttn">
<p>
<span class="bigger"><?php echo $record['name'] ?> </span><br>
<p><?php echo $record['button_text'] ?></p>
<a href="<?php echo $record['_link'] ?>"><img src="images/find-out-more.gif"></a><br/>
</p>
</div>
<?php endforeach; ?>
Then you get one <div> per service.
I've attached a modified version of your index2.php file with the above change.
P.S. You should probably be using class="bttn" instead of id="bttn". IDs are meant to be unique. Whether or not this will cause any real problems with browsers is anyone's guess though.
All the best,
Chris