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.

Template Questions

How to hide a page type


Go to End
Reply

9 Posts   2808 Views

Avatar
iroy2000

25 November 2010 at 11:55am (Last edited: 25 November 2010 11:57am), Community Member, 15 Posts

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

25 November 2010 at 6:50pm Forum Moderator, 5511 Posts

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

Avatar
iroy2000

26 November 2010 at 6:12am Community Member, 15 Posts

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

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

Avatar
Garrett

15 March 2011 at 4:43am Community Member, 245 Posts

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

16 March 2011 at 10:08am Forum Moderator, 1091 Posts

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

16 March 2011 at 10:59am Community Member, 245 Posts

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

17 March 2011 at 12:46am Forum Moderator, 1091 Posts

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

17 March 2011 at 2:35am Community Member, 245 Posts

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