Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to hide a page type


Go to End


9 Posts   5008 Views

Avatar
iroy2000

Community Member, 15 Posts

25 November 2010 at 11:55am

Edited: 25/11/2010 11:57am

Hi all,

I created a page type called

"BannerHolder" and "Banner".

What I want is, I just want to include the "bannerHolder" into other page, but not a standalone page.

But when I create that in the CMS, in my front end, I saw "Banner Holder" in my navigation.

Is there anyway to hide the BannerHolder type from navigation???

Thanks

Avatar
Willr

Forum Moderator, 5523 Posts

25 November 2010 at 6:50pm

Well you can untick 'ShowInMenu' for the page in the Behaviour tab in the CMS.

Avatar
iroy2000

Community Member, 15 Posts

26 November 2010 at 6:12am

LOLz, it's my bad. I removed the behavior field for that type..

$fields->removeFieldFromTab("Root","Behaviour");

Avatar
Garrett

Community Member, 245 Posts

15 March 2011 at 4:43am

What I need to do is a step further -- I need a certain page type not to show in the site tree. I have two page types that both have a has_many relationship to third page type, the problem is that when the relationships are made and saved, a row is created in the relational table and so these relations themselves show up in the CMS as empty pages (of page type ProductPage_BusinessNeed). How can I specify in the CMS that these pages simply do not Show?

Thanks,
Garrett

Attached Files
Avatar
martimiz

Forum Moderator, 1391 Posts

16 March 2011 at 10:08am

If I understand you correctly, you really don't want them to be Pages at all, ever? Not as standalone Page in your Website, not in your create-page-dropdown in the CMS and notin the SiteTree?

If that's the case you could very well use a DataObject instead of a page type, since a page is only a sophisticated DataObject anyway...

Avatar
Garrett

Community Member, 245 Posts

16 March 2011 at 10:59am

Thanks for your reply. Your assumptions are correct. However, I cannot use a DataObject because of that classic SS problem -- HTMLEditorField doesn't work in the modal popup -- and this page type must contain an HTML-friendly Content field. Any other ideas?

Thanks again,
Garrett

Avatar
martimiz

Forum Moderator, 1391 Posts

17 March 2011 at 12:46am

Depends on how HTML-friendly the thing is supposed to be, and what it's for.

- If it is just, for instance to include some flash banner, or other 'semi-fixed' HTML you could and probably even should do that using your templates without need for a WYSIWYG at all.

- I know the DataObjectManager module includes a number of simple HTML editors, that could work if your HTML content doesn't need all the ins and outs of the complete TinyMCE editor.

- You could consider the use of ModelAdmin, although I'm not sure if including the TinyMCE field already works out of the box
http://www.silverstripe.org/data-model-questions/show/4983

But if you stick to using Pages, I really don't understand why you would want to keep them out of the CMS SiteTree, since there would be no way to ever edit/delete them at all...

Avatar
Garrett

Community Member, 245 Posts

17 March 2011 at 2:35am

The HTML I need would be links and paragraphs, and of course it's not fixed at all as the client will be populating these content fields. The reason I need to keep them out of the CMS SiteTree is because since a new instance of this third page type is created in the CMS every time a relationship is created between the other two page types, it is mucking up the CMS terribly as these pages don't have titles, not to mention there are several dozen of them. See the screenshot and you'll get it.

It is too late for me to redesign it completely using ModelAdmin, though I erally would like to try extending that in the future. Meantime' I'll look into what other HTML fields are available in DataObjectManager.

//Garrett

Attached Files
Go to Top