Hi,
I'm working on some code to generate a Tab Container with Tabs (which will then be rendered using jQuery). because this will be Tab content, it should not show in Menu and Search and so on so I switched this off in the defaults for those page types (TabContainer and TabContent).
Now I went to work on the coding and found that my tabs (as children of the tabscontainer) did not show up if I did a <% control Children %> in the TabsContainer template or in the controller for that page (as object->Children())... I found this was due because in the CMS, the tickbox 'Show In Menu' was off... Seemed very weird to me and took me ages to find out...
Is this by design? And if yes - WHY? It would make sense to exclude those pages that are set not to show in menu if you <% control Menu %> but it seems, they completely dissapear from the parent object..
The only way to get to these children was by accessing the dataobject on the controller of the TabsContainer:
public function getTabs(){
return DataObject::get("TabContent", "ParentID = $this->ID");
}
It works - but still - this seems really counterintuitive and not very MVC to me..