Reputation: 1454
I have extended the BlogEntry class and added three new pagetypes: -
class ResourceBlogEntry extends BlogEntry { ... }
class NewsBlogEntry extends BlogEntry { ... }
class MediaBlogEntry extends BlogEntry { ... }
They are showing up fine in the new page list when I try to add a child page of a BlogHolder. The problem is the original BlogEntry pagetype is still showing up in the list and I can't remove it. I have tried all the methods on the following page without success: -
http://www.balbus.tk/hide-a-page-from-the-cms-pagetype-dropdown/
I don't know what I am doing wrong.
FYI, this website is using SilverStripe version 3.1.
MORE INFO
I have also used a dataextension on the BlogEntry page type, I don't know if that is the problem.
class CustomBlogEntry extends DataExtension {
Upvotes: 0
Views: 418
Reputation:
You do this by setting the hide_ancestor
static to the name of the class you want to hide.
In this case, you'd use
class ResourceBlogEntry extends BlogEntry
private static $hide_ancestor = 'BlogEntry';
}
Remembering to flush after you add it.
Upvotes: 2
Reputation: 3754
You can do this using the hide_ancestor
flag on one of your subclasses. In SilverStripe 3.1+ you need to configure this using a private static:
class ResourceBlogEntry extends BlogEntry {
private static $hide_ancestor = true;
}
Upvotes: 1