Questions tagged [symfony-sonata]

The goal of the Sonata Project is to provide an e-commerce framework solution based on the Symfony (version 2 and 3) framework.

The goal of the Sonata Project is to provide an e-commerce framework solution based on the Symfony2 framework. Think of it as a toolkit based on Symfony2 components to make building e-commerce sites easy and fun!

http://sonata-project.org/about

599 questions
11
votes
3 answers

Extending Sonata User Bundle and adding new fields

I am extending the Sonata User Bundle and creating some extra fields in the new user entity. These fields will only be updated within the Sonata admin area under users so they do not need to be available in the edit profile form. I am having trouble…
Justin Griffith
  • 273
  • 1
  • 3
  • 11
10
votes
2 answers

Add custom Sonata page route to the navbar

I've created a custom Sonata page Simple route medapp_adminStreamCommands: path: /admin/stream defaults: { _controller: MedAppBundle:VideoChat/VideoChat:adminStreamCommands } Controller that returns the admin pool public function…
George Irimiciuc
  • 4,573
  • 8
  • 44
  • 88
9
votes
1 answer

Adding a custom form inside the show template of a Sonata Admin Entity

I want to generate a small form inside a Sonata Admin show template. What I have done so far is creating the function in the custom CRUD for that specific entity (order) that extends from Sonata's default CRUD; public function approveOrderAction($id…
Jack Brummer
  • 583
  • 1
  • 6
  • 14
9
votes
3 answers

Symfony2 - Sonata Admin - add javascript before field

In admin class: protected function configureFormFields(FormMapper $formMapper) { $formMapper ->add('name', 'text') ->add('description', 'text') ; } I don't know how I can before "name" add javascript, can you help…
tengopl
  • 453
  • 1
  • 4
  • 9
9
votes
1 answer

IntlDateFormatter::format(): datefmt_format: takes either an array or an integer timestamp value or a DateTime object (SonataSanBox)

I have installed SonataAdmin Bundle. All is working fine but, when I add any user from dashboard, it throws a warning: Warning: IntlDateFormatter::format(): datefmt_format: takes either an array or an integer timestamp value or a DateTime object in…
Krishna Ghodke
  • 589
  • 2
  • 6
  • 26
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
1 answer

FOSRestbundle, JMS Serializer and SonataMediaBundle return public url for image

I'm trying to return a JSON object('Module') with a ManyToOne link to an Sonata\MediaBundle\Entity through FOSRestBundle and JMS Serializer. How should I go about doing that? Here's a hack that I did, but dont think it's the best practise. class…
hongpang
  • 93
  • 1
  • 6
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

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

Dynamic relationship and the SonataAdminBundle

I use the SonataAdminBundle for the first time in my life and I have some problems with it. At first, I had a PageBundle which has a Page and a Author entity. Then I started using SonataAdminBundle and used the sonata_type_model to nicely display…
Wouter J
  • 41,455
  • 15
  • 107
  • 112
7
votes
1 answer

Sonata Admin - Only allow show what logged in user has created

I've setup a sonata admin interface which allows users to create specific content, but how do I restrict users from editing content created by other users? For arguments sake, a user logs in and creates a blog. In the list view of blogs, only the…
user1697652
  • 248
  • 4
  • 6
1
2
3
39 40