category records - Get options from database - displayed as bullets

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 17, 2011   (RSS)

Re: [zick] category records - Get options from database - displayed as bullets

By Jason - January 17, 2011

Hi,

In your code, you have a record variable $productsRecord. Is this the record you want to display?

In your code your creating $currentDrill array with all the records from the 'keywords' table.

If you want to get an array of just the list labels for the record your current working with, you could do it like this:

<?php $keywords = getListLabels('products', 'keywords', $productsRecord['keywords']);?>

<ul><?php foreach ($keywords as $keyword): ?>
<li><?php echo $keyword;?></li>
<?php endforeach ?> </ul>


If you're using CMS Builder version 2.04 or higher, you can use the :labels pseudo field like this:

<ul><?php foreach ($productsRecord['keywords:labels'] as $keyword): ?>
<li><?php echo $keyword;?></li>
<?php endforeach ?> </ul>


Is this more what you're looking for?

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/