0

I want to edit content on my app using the WYSIWYG editor in CMF. The getting started tutorials are all focused on how to setup the backend of the application. However, the frontend is what I don't really understand how to setup.

In these examples, code inspection shows the special RDF attributes added to the markup, such as about and property. I assume I'm supposed to add these to my Twig templates, but how are the changes submitted?

ecc
  • 1,490
  • 1
  • 17
  • 42

1 Answers1

0

The CreateBundle handles this. All you need to do is enable the bundle, define a mapping file and render the document in the template with twig functions, similar to when rendering a form. The CreateBundle provides a controller that handles the back channel for posting the updated data. Read the detailed documentation in the Symfony CMF documentation.

dbu
  • 1,497
  • 9
  • 8
  • Thanks for the asnwer. I accepted it but I still got some doubts. CreateBundle makes everything automagically, and that's nice. But if I want to have my own controller that handles the submissions prior to persisting them, is there a way to do my thing and then pass it along to CreateBundle for handling and persisting? – ecc Mar 20 '15 at 17:29
  • You have a couple of options for this: Event Listeners on doctrine, adding validation to your documents, or what you originally want, change the controller. for that you can: define your own service and configure that route instead of the default, or change the configuration for rest_controller_class (needs compatible constructor however). look at Symfony\Cmf\Bundle\CreateBundle\Controller\RestController - most likely you want to extend that class and add things in its action method. Feel free to open issues on github if you need more flexibility - happy to make CreateBundle more customizable. – dbu Mar 23 '15 at 07:43