17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1451 Views |
-
hide_ancestor not working

3 August 2007 at 9:54pm Last edited: 3 August 2007 11:09pm
I am trying to hide the ancestor class, but in the sitetree the pagetype 'Productgroup' is still available. Anyone has an idea why?
class ProductGroupRandom extends ProductGroup {
static $hide_ancestor = ProductGroup;
}class ProductGroupRandom_Controller extends ProductGroup_Controller {
public function Testfuntion($showAll = false) {
$hallo="test";
return $hallo;
}
} -
Re: hide_ancestor not working

4 August 2007 at 4:49pm Last edited: 4 August 2007 4:53pm
There's some more reference for this that can be found here:
http://www.silverstripe.com/general-discussion/flat/2741
It's possible that the fix was implemented into the development branch of SilverStripe, so perhaps the code change on that forum post will help.
Cheers,
Sean -
Re: hide_ancestor not working

4 August 2007 at 4:51pm Last edited: 4 August 2007 4:53pm
You might also want to try putting $hide_ancestor = 'ProductGroup'; rather than just ProductGroup.
The wiki page for it was found here: http://doc.silverstripe.com/doku.php?id=hide-ancestor
Cheers,
Sean -
Re: hide_ancestor not working

6 August 2007 at 10:06pm
I checked SiteTree.php and the code is the same as in the posted forum thread. I also added the quotes but the page 'Productgroup' is still available.
$instance = singleton($class);
if((($instance instanceof HiddenClass) || !$instance->canCreate()) && ($class != $this->class)) continue;$addAction = $instance->uninherited('add_action', true);
if(!$addAction) $addAction = "a $class";
| 1451 Views | ||
|
Page:
1
|
Go to Top |


