Show list selections as separate items

6 posts by 2 authors in: Forums > CMS Builder
Last Post: November 19, 2013   (RSS)

By zip222 - November 19, 2013 - edited: November 19, 2013

Try this instead of the join()...

<?php 
   // creates array of tag values and labels
   $tags = array_combine($record['tag:values'], $record['tag:labels']);
?>

   <?php foreach ($tags as $tag_value => $tag_label): ?>
      <div class="tagbox">
         #<?php echo $tag_label; ?>
      </div>
   <?php endforeach ?>

By s2smedia - November 19, 2013

I'm getting this error:

Notice: Undefined variable: newsRecord in /XXXXXXXXX/index.php on line 214 Warning: Invalid argument supplied for foreach() in XXXXXXXXXXX/index.php on line 214

By zip222 - November 19, 2013

There was a typo in the foreach line. try replacing that line and see if it works now.

By s2smedia - November 19, 2013

Doesn't seem to be changed:

http://www.s2smedia.net/Trends/

heres what i have:


 <?php 
   // creates array of tag values and labels
   $tags = array_combine($record['tag:values'], $record['tag:labels']);
?>
<?php foreach ($tags as $tag_value => $tag_label): ?>
<div class="tagbox">#<?php echo $tag_label; ?></div><?php endforeach ?>

By s2smedia - November 19, 2013

Sorry! never mind I got it!! thx