Re: [Jason] Adding Individual Sidebar boxes/features
The code worked great! Thank you!
Is it possible to add two more variations of the sidebar box layout to be included in the random display.
For example, right now all of the boxes use "boxList.php" and it's a simple title, subtitle & content display.
I would like to have to two additional box layouts that would display randomly in the mix with the first set. I've
already set those up as two single records: box2 and box3
For example:
• box2 would display 2 random testimonials automatically pulled from the testimonials page (patient_testimonialsRecords)
• box3 would be a small photo gallery using a js slideshow script
Essentially they will each have the same setup (title, subtitle & content area - testimonials & js slideshow)
I've attached a screenshot of what I have now. I'm assuming I can't just add another version of the box
layout in boxList.php but that I have to have new layouts (boxList2.php & boxList3.php).
I hope that all made sense. Thank you!! Tina
CURRENT CODE: (stripped down) =====================
<?php
// load records
list($boxRecords, $boxMetaData) = getRecords(array(
'tableName' => 'box',
'allowSearch' => false,
'limit' => '3',
'orderBy' => 'RAND()',
));
?>
<?php foreach ($boxRecords as $record): ?>
<?php echo $record['title'] ?>
<?php echo $record['subtitle'] ?
<?php echo $record['content'] ?
<?php endforeach ?>
<?php if (!$boxRecords): ?>
No records were found!<br/><br/>
<?php endif ?>