symfony-cmf / content-bundle

Provides some basic document classes and controllers for modeling content
https://cmf.symfony.com
19 stars 32 forks source link

make routing-bundle and menu-bundle suggested only #39

Closed lsmith77 closed 11 years ago

lsmith77 commented 11 years ago

in the admin class check if the admin classes for routing and menu are available before adding them to the form.

sjopet commented 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

dbu commented 11 years ago

could be interesting for other use cases too. but for 1.0 i would be happy with class_exists in the admin.

krizon commented 11 years ago

Will work on this ticket tonight

dbu commented 11 years ago

@sjopet btw, if we would use admin extensions, can we control in what order the tabs appear?

dbu commented 11 years ago

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.

sjopet commented 11 years ago

@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.

dbu commented 11 years ago

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?

sjopet commented 11 years ago

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.