Blog Posts

A frontend editor for Symfony2 CMF with the help of VIE

Yesterday we started working on an editor for the Symfony2 Content Management Editor, the LiipVieBundle. We use VIE and - until something non-GPL comes along - the Aloha editor. VIE is a piece of javascript on top of backbone.js that handles storing data with a REST backend. In Symfony2, this is a breeze thanks to the FOSRestBundle. Sounds complicated? Its actually quite simple, at least for the user. I made a short video to show how it looks.

You can try this out in the CMF Sandbox. Currently, its just a proof-of-concept implementation. For example, we make no authorization check whatsoever. In the upcoming weeks, we plan to do the following:

  • Only activate VIE if the user has the required role (inject an authorization service into the VieController)
  • Support authorization service in REST controller
  • Image insert feature in aloha
  • Find a way for developpers to configure what editor to use for each field
  • Support binary fields / file attachments
  • Autosave while editing to not lose data on connection errors

If you have feedback or inputs to this, please tell! And if you can contribute, you are more than welcome to do pull requests or comment on commits. Whatch the LiipVieBundle and the sandbox to see what is happening.

Related Entries:
- Semantic web meets frontend-awesomeness
- What Liip did after winning the IKS semantics UX contest
- Symfony CMF hackday october 22nd in Cologne
- Progress on PHPCR with a hackday
- Symfony CMF: what is left todo?

About the author


Find more about him on Twitter, Google+ and his personal site.

Comments [11]

Lukas, 27.09.2011 12:02 CEST

TinyMCE also has RDFa support last I heard:
http://en.wikipedia.org/wiki/Tinymce

ITs LGPL rather than AGPL.

Furthermore there is Hallo Editor under the MIT license:
https://github.com/bergie/hallo

david, 27.09.2011 13:40 CEST

if it had a plugin for image insertion, hallo would be a very interesting option. then the symfony cmf asset management could integrate with such a plugin. i think that would be better (easier?) than changing aloha to integrate with that asset management component.

Henri Bergius, 27.09.2011 13:47 CEST

There are quite a few editors with less limiting licenses, but Aloha is the one with a nice UX.

Hallo is still mostly in a proof-of-concept stage, but I hope it'll become a nice alternative for those who need a completely non-intrusive, minimalistic editor that has license allowing it to use where ever.

Here is a bit about Hallo's goals:
http://bergie.github.com/hallo/

Anyway, great to see VIE in Symfony CMF. If there is anything you need help with, just let me know!

Gerald, 29.09.2011 16:39 CEST

I recently found Mercury jejacks0n.github.com/mercury/ and I really like the different approach. I am planning to give it a try and I would love to see it in a Symfony CMF! (no, I dont have any share in it ;-)

david, 29.09.2011 16:47 CEST

hey, that looks interesting. atm, i think we have to leave it up to somebody who wants to try to integrate mercury.
the no IE support is a no-go for a default editor, we hope to do projects in a business context where (even older versions of) IE will be around.
but it would be great if somebody wants to play around with integrating mercury. in a couple of years when IE supports HTML5 (or has finally left the market :-) this could be a good option for general-purpose projects too.

Jarvis, 04.10.2011 22:19 CEST

I haven't been able to see Vie in action in the CMF Sandbox. I even searched inside for VIE.EntityManager and other code to no avail. I'm not sure where it's supposed to go.

I don't think I missed a step during installation of the sandbox. It runs.

Let me know,
Jarvis

david, 05.10.2011 11:57 CEST

i think the problem is that currently it will only work if you have the coffee script compiler installed. which in turn needs node.js :-(
i am trying to clean this up so it will work again.

david, 05.10.2011 15:29 CEST

ok, it is not that easy because VIE got a full rewrite since we started...

but for now we just added the legacy vie.js and supporting files to the repository. if you have coffee enabled, things will just work after running
bin/vendors install

if you don't have coffee, you can change the vendor/bundles/Liip/VieBundle/Controller/VieController.php
to use LiipVieBundle::includejsfiles-hallo.html.twig instead of LiipVieBundle::includecoffeefiles-hallo.html.twig

Jarvis, 05.10.2011 15:42 CEST

Thanks! I will check it out! Keep up the great work.

SF2, 16.03.2012 04:58 CEST

I wish people would stop making half assed bundles like this and then publishing them. We need a way to discover bundles that are fully working bundles.

david, 16.03.2012 09:39 CEST

@SF2: thats not very constructive feedback. if something does not work for you, then please fix it and send a pull request. and if you can't then open an issue and describe what your problem is. ranting around won't help you a bit.

Add a comment

Your email adress will never be published. Comment spam will be deleted!