_isSelectedBranch value not set on child records

4 posts by 3 authors in: Forums > CMS Builder
Last Post: March 2, 2009   (RSS)

By aev - March 2, 2009

Hi!

The "_isSelectedBranch" value introduced in 1.27 is not set on child records in the selected branch.

-aev-

Re: [ross] _isSelectedBranch value not set on child records

By aev - March 2, 2009

From the CMSB changelog:
http://www.interactivetools.com/products/cmsbuilder/changelog.html
- Categories: Added _isSelectedBranch field to getCategories() viewer function output


This field is supposed to tell if a record is in a selected category branch. This means that all records beneath a toplevel category where a record is selected should have _isSelectedBranch = 1.

Do a "print_r ($categoryRecords);" on a site using categories and you'll see what I mean. Maybe Dave can help.. I requested this feature to him.

-aev-

Re: [aev] _isSelectedBranch value not set on child records

By Dave - March 2, 2009

Hi aev,

I added this code to viewer_functions.php:
$category['_isSelectedBranch'] = $selectedCategory && preg_match("/:{$category['num']}:/", $selectedCategory['lineage']);

Do you want to email me direct and send me links to your example. We can add or change something if needed.
Dave Edis - Senior Developer
interactivetools.com