parentNum:label

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 27, 2016   (RSS)

By Toledoh - May 24, 2016

Hey Guys,

I'm trying to find out how to get the "label" rather than the "value" of <?php echo ($selectedCategory['parentNum']) ?>

Any ideas?

Cheers,

Tim (toledoh.com.au)

By Damon - May 26, 2016

Hi Tim,

Tyr this code. Change names to match your code.

<?php foreach ($categoryRecords as $parentRecord): ?>
  <?php if($selectedCategory['parentNum'] == $parentRecord['num']) : ?>
    Parent name: <?php echo $parentRecord['name'] ?><br />
  <?php endif; ?>
<?php endforeach; ?>

Let me know if this works for you.

Cheers,
Damon Edis - interactivetools.com

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

By Toledoh - May 26, 2016

Thanks Damon - that works - but a lot of messing around.  

Can I ask why there isn't the ability to have parentNum:label seeing that there is parentNum already working fine, and it does have a "label"?

I find categories very confusing at times, but extremely powerful - so just trying to get it clear in my head for next time:)

Cheers,

Tim (toledoh.com.au)