Closed lsmith77 closed 11 years ago
I think it might be possible to move the menu and routes tab to an extension. Then you can add the extension to the correct bundle and don't have to worry about dependencies. I'm not sure if there are interfaces we can use to add those extensions to the correct admin though
could be interesting for other use cases too. but for 1.0 i would be happy with class_exists in the admin.
Will work on this ticket tonight
@sjopet btw, if we would use admin extensions, can we control in what order the tabs appear?
started to have admin extension for routing and menu. that is way cleaner: symfony-cmf/MenuBundle#103
for the full StaticContent class, as it implements interfaces from menu and routing it can not be independent. but we can still make the dependencies suggests only so people can use the StaticContentBase and the controller.
@dbu, didn't see you question before but yeah you can influence the order of fields by calling the $formMapper->reorder() function passing an array with the field names array('field1', 'field3', 'field2'). The downside of that is that you have to know the actual field names.
thanks, good to know. so there is a last resort if somebody is unhappy with what the magic does for him. i would need to know the tab names, not field names, right? or is that only to reorder the fields inside the tab? useful too, but does it also allow to reorder the tabs themselves?
No, it seems you can't reorder the tabs. which is something that needs to be added to sonata-admin imo. Ideally by allowing the user to specify a priority for each tab because when you are using extensions you don't always know which tabs an admin has and reordering with an array of names isn't going to work in that case.
in the admin class check if the admin classes for routing and menu are available before adding them to the form.