parentNum:label

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

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)

By Damon - May 27, 2016

Hi Tim,

I was chatting with Ross and neither of us has had this come up. To add this functionality, extra code would need to be written in the backend and then run every time to return that specific psuedo field value.  Right now, the same result can be done with custom code. My code was just one example way of doing it. 

I have already discussed this with Dave as something you are interested in seeing added.

Thanks!

Cheers,
Damon Edis - interactivetools.com

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