Re: [aev] Apply field value from parent to children inside a category section
Hi aev,
This one is pretty advanced and may take some thinking and/or custom code... Some ideas:
- In the admin: You could write a plugin so when you set/unset hidenav of a category record all the children got the same setting.
- When displaying: When displaying each record you could loop over all the parents and see if any of them had hidenav set. Here's some example untested pseudo-code:
<?php
$parentHideNav = false;
$parentNums = explode(":", $category['lineage'];
foreach ($parentNums as $parentNum) {
if (@$categoriesByNum[$parentNum]['hidenav']) { $parentHideNav = true; }
}
?>
Or maybe to that at the top and set a fake pseudo-field called _parentHidden for each child.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com