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
43
votes
2 answers

SonataAdminBundle custom rendering of text fields in list

I'm using symfony2 and SonataAdminBundle. I have a simple Entity called Post in which I have content field that is basically html text (from a ckeditor for the record). I need to display in the Post list the content field as raw html, without…
giorrrgio
  • 502
  • 1
  • 4
  • 10
37
votes
14 answers

Programmatically set the value of a Select2 ajax

I have a Select2 auto-complete input (built via SonataAdmin), but cannot for the life of me figure out how to programmatically set it to a known key/value pair. There's a JS Fiddle here that shows roughly what I have. What I want to know is what…
caponica
  • 3,788
  • 4
  • 32
  • 48
31
votes
3 answers

How can I perform an inline editing inside a nested admin?

My problem is the following. I am using Sonata Admin with Symfony. In the Admin section, when I try to create an entity, nothing appears when I click on the add button (spelled "Ajouter"): I get the following error: Call to a member function…
Etienne Noël
  • 5,988
  • 6
  • 48
  • 75
29
votes
4 answers

How to use Ajax within Sonata Admin forms?

I have a Merchant entity with the following fields and associations:- /** * @ORM\ManyToMany(targetEntity="Category", inversedBy="merchants") */ public $categories; /** * @ORM\ManyToMany(targetEntity="Tag", inversedBy="merchants") */ public…
Amit
  • 3,644
  • 9
  • 38
  • 49
27
votes
1 answer

SonataAdminBundle with translatable fields (doctrine extensions)

I'm having a table with all translations in a "ext_translations" table. The translating works great. The problem is now: I want to manage those translations via sonata-admin bundle. I have already found a documentation, how to get work doctrine…
eav
  • 2,123
  • 7
  • 25
  • 34
26
votes
5 answers

SonataAdminBundle : display non crud (statistics)

I'm using sonata admin bundle to generate my backend, I'm so happy with it that I would like to use my backend to display statistics as well. I guess I can do that by tweaking bundle's views, "standard_layout.html.twig" maybe. Problem is, I can't…
copndz
  • 1,104
  • 2
  • 12
  • 23
25
votes
5 answers

Sonata Admin Bundle: DatePicker range

How would I create a doctrine_orm_datetime_range filter in the Sonata Admin Bundle which uses the jQuery UI datepicker? I tried the following, but it doesn't work: protected function configureDatagridFilters(DatagridMapper $datagridMapper) { …
24
votes
2 answers

Nested collection fields in Sonata Admin (2.3)

I'm having problems creating my form for creating a course. This is a part of my database scheme for which I'm trying to create a form: So which I'm trying to do is create a course where I can create sessions and dates (moment) attached to that…
nielsv
  • 6,540
  • 35
  • 111
  • 215
24
votes
4 answers

Sonataadminbundle: Multiple admin section for same entity

I have entity class Page with column type=integer. When I do:
Zeljko
  • 5,048
  • 5
  • 36
  • 46
23
votes
6 answers

How to get container instance in sonata Admin class?

I need to parse some configurations parameters from my config.yml such as enabled languages. But when i try to do that by using the normal symfony method: $this->container->get('my_params'); it fails because my admin class extends…
skonsoft
  • 1,786
  • 5
  • 22
  • 43
22
votes
1 answer

Symfony2 Admingenerator vs. Sonata admin

Just found out about this new project Symfony2 Admin Generator. It is for easy development of backends for symfony2 based applications. I was wondering, how this tool is different from Sonata admin project? Is there any use case where this new admin…
gatisl
  • 1,870
  • 1
  • 16
  • 18
20
votes
2 answers

How to add custom link or button to SonataAdminBundle Dashboard in Symfony2

I am new with symfony2 and SonataAdminBundle. I have added 3 entities to the SonataAdminBundle Dashboard and they appear successfully. The Entities appear with the default links - "Add new" and "List" buttons. I want to be able to do the…
dagger
  • 515
  • 2
  • 6
  • 17
19
votes
2 answers

How to implement many-to-many relationships in Sonata Media Bundle

I am trying to relate SonataMediaBundle to another Entity: Products with a relation ManyToMany. The schema and relation are well created. However, when I edit or create a new product, I try to add a button where I can search a media file through…
fidelio
  • 223
  • 3
  • 9
18
votes
6 answers

Is there any way to determine current action (create or edit) in Sonata\AdminBundle\Admin\Admin::configureFormFields()?

I'd like to create different fields configuration for create and edit actions in Sonata Admin Bundle. Is there any way to determine it except checking $this->getSubject()->getId() in Sonata\AdminBundle\Admin\Admin::configureFormFields()?
Max Romanovsky
  • 2,824
  • 5
  • 30
  • 37
17
votes
4 answers

Sonata Admin: How to remove "Add New" button from dashboard only?

I'm using Symfony 2.7 with Sonata Admin Bundle to manage some products and product images. I used the Sonata Admin Cookbook recipe: https://sonata-project.org/bundles/admin/master/doc/cookbook/recipe_file_uploads.html for images. Because an image…
VMC
  • 1,378
  • 4
  • 16
  • 32
1
2 3
99 100