I am using silverstripe 3.0.0
Need to hide/show certain pages in the CMS tree view as well as list view and also all other places where they are displayed in the back end...like TreeDropDownFields etc.
This is based on a field value
I have tried by defining canView in Page.php but it doesn't work the way i want..
What worked for me was the following (added this code to an extension of SiteTree)
function augmentSQL(SQLQuery &$query) {
if(my condition here)
return;
else
$query->addWhere(where condition here);
}
Need to know if there is any better way than this....Any side effects of the above piece of code? Also need to add a filter for the Groups in the same way....