Questions tagged [sonata-admin]

SonataAdminBundle is a Symfony bundle to generate robust user friendly administration interfaces.

Useful links

The Sonata Project is an open source set of bundles which are built on top of Symfony2. It's majorly based on the community work around the globe and uses the most known bundles released by:

2072 questions
8
votes
4 answers

How is the best way to add select with choices to filters in Sonata Admin?

How is the best way to add select with choices to filters in Sonata Admin? For form i can: $builder->add('gender', 'choice', array( 'choices' => array('m' => 'Male', 'f' => 'Female'), 'required' => false, )); but this not working in…
makuj
  • 97
  • 1
  • 5
8
votes
4 answers

Disable search in Sonata Admin

How can I disable the search feature in Sonata Admin Bundle, in order to not show the search input field in the upper menu?
Guillermo Gutiérrez
  • 17,273
  • 17
  • 89
  • 116
8
votes
2 answers

Symfony Sonata admin languages not work

I install Sonata admin Bundle, everything work but I don't have any language - buttons and text in admin is like before translated example : label.select_context , btn_filter (not filter but btn_filter) and other - where I can setup language to…
Developer
  • 2,731
  • 2
  • 41
  • 71
8
votes
3 answers

Sonata Admin one-to-many relationship with file upload (appendFormFieldElement)

I'm currently facing a challenge with SonataAdminBundle, one-to-many relationships and file uploads. I have an Entity called Client and one called ExchangeFile. One Client can have several ExchangeFiles, so we have a one-to-many relationship here.…
thomaskonrad
  • 665
  • 1
  • 9
  • 24
8
votes
3 answers

How to get underlying object in Sonata's Admin class when called by sonata_type_admin?

So, in edit action of Sonata Admin I'm trying to display different form fields depending on create or edit context. Maybe some background first.. I have a Gallery entity and a CoverPhoto entity bound with OneToOne. Gallery: /** *…
flameheart
  • 369
  • 1
  • 2
  • 9
8
votes
2 answers

With SonataAdminBundle. Configure filter on a two step related entity

I'd like to know weather is possible and how to configure a filter for the list view as the following with SonataAdminBundle in Symfony 2 Say I have entities Order, pointing to entities User, pointing to entities Company. I want to configure filters…
javigzz
  • 942
  • 2
  • 11
  • 20
8
votes
2 answers

Sonata Admin Bundle Type Collection Customisation

For example I have 3 entities: Category Subcategory Product In SonataAdminBundle I'd like to be able to add Subcategory while editing Category and Products while editing Subcategory. Following this idea I created fields, but SonataAdminBundle…
Jun Murakami
  • 815
  • 1
  • 9
  • 17
8
votes
2 answers

Symfony2: Overriding createAction() in SonataAdmin

I've been googling as crazy the last days trying to figure out (with no success) how override a SonataAdmin action to capture the session username and save it in the foreign key field. AttachmentAdminController class:
abiyi
  • 394
  • 2
  • 6
  • 16
8
votes
4 answers

How to remove "delete" button in default "Edit" form of sonata admin?

I wrote a code to list data taken from a simple database and there I put an action to edit data. When I click on this Edit button, it goes to the default "Edit" page. There is a button called "delete" there. I want to remove that button...
user1548055
  • 91
  • 2
  • 5
8
votes
1 answer

Sonata Admin Bundle - Form type: sonata_type_collection - custom template?

Is it possible to override the template for the form type: "sonata_type_collection"? Ive tried along these lines: $formMapper->add('slides', 'sonata_type_collection', array(), array( 'edit' => 'inline', 'inline' =>…
lopsided
  • 2,370
  • 6
  • 28
  • 40
8
votes
1 answer

custom action in SonataAdminBundle

On this page I found how to add route for my custom action. protected function configureRoutes(RouteCollection $collection) { $collection->add('ispremium', $this->getRouterIdParameter().'/ispremium'); } After that I add custom action in my…
Sergei Zherevchuk
  • 562
  • 1
  • 5
  • 14
7
votes
2 answers

Sonata admin - child admin class

I have an Order entity, which can have multiple LineItem entities associated. I've created an Admin class for Order and an Admin class for LineItem. But I need the LineItem Admin class to be a child of the Order Admin class. In the LineItemAdmin…
agentar
  • 265
  • 2
  • 4
  • 9
7
votes
0 answers

sonata_type_collection edit in modal

In my project, I have pages and elements linked to them. An element can be linked to only one page. I have a specific form to choose a field mask and many fields. I would like to have a list of elements linked to a page instead of embedded forms. Is…
Christophe Ferreboeuf
  • 1,048
  • 14
  • 26
7
votes
1 answer

Sonata User Bundle + Symfony 3.x

I use Symfony 3.0.6, Sontata Admin Bundle 3.0.0 and the Doctrine ORM Admin Bundle on dev-master. The user bundle doesnt work even with dev-master. Is there a solution for Symfony 3.x yet? Your requirements could not be resolved to an installable set…
user1878703
  • 103
  • 1
  • 4
7
votes
2 answers

How to override Show field in sonata admin

I want show the list of multiple attributes Name => value in a table overriding single field of only for PortsAdmin in ShowMapper Ports Entity mapped with PortsAttributes Entity. Relation of entity is OneToMany Ports with multiple attributes. Admin…
Noman
  • 4,088
  • 1
  • 21
  • 36