Use json instead of form for block editing



The use of a form for block editing runs out in a conflict when blocks with other forms are on the page. The page cannot be edited in this case.

The use of JSON ajax would be much better, also because it would remove the dependency with the PageController.

6 commits have already been made, status is unknown


  • Don't use form to edit blocks, use JSON ajax instead, because editing a page with form block currently results in an error due to form conflicts

  • Must post to a Grid controller, so it can be used in multiple places

  • Preservice consistency with navigation editing

Technical tasks


Deployment actions

remove javascripts (also jquery ui) from base view (are now loaded with asset manager)

{% javascripts output='js/scripts.js'
'@IntegratedWebsiteBundle/Resources/public/js/grid.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

Remove edit form

Add handlebars:

{% if integrated_block_edit|default %}
{{ include('@IntegratedWebsite/handlebars/grid.html.twig') }}
{% endif %}

{% if integrated_menu_edit|default %}
{{ include('@IntegratedWebsite/handlebars/menu.html.twig') }}
{% endif %}

Remove template 'IntegratedWebsiteBundle:Form:form_div_layout.html.twig' from config.yml


Johan Liefers
May 22, 2017, 10:01 AM

No it's not really better, just works better with sortable blocks, but I couldn't get the sortable blocks working with jquery-ui, but in general I don't think that the johnny sortable is better.

Marijn Otte
May 22, 2017, 11:18 AM

I think there are two options:
1) revert the change to johnny sortable and deliver the issue with jquery sortable
2) move to the johnny sortable and create a new issue to make the menu-bundle consistent. I don't think that should be done in this issue, in this phase

Johan Liefers
May 22, 2017, 1:08 PM

I spent more than an entire day trying to get the johnny sortable ok, and fixing the serializing for saving, so I really wouldn't want to revert all my changes for a system that works worse.

Also option 2 I would be a pity if that should be done, it works fine as it is right now, you would need to spend a lot of time fixing it with johnny sortable. You could then remove jquery-ui, but if a user needs jquery-ui for their own site it would not work anymore.

Marijn Otte
May 23, 2017, 7:19 AM

I think it is not a real problem the navigation and blocks use a different script. The same script for both would be a little more efficient and maybe a bit easier to maintain, but changing the navigation should not be done in this issue (and I think it is not worth the investment at this time anyway)

Marijn Otte
May 23, 2017, 1:35 PM
  • The behaviour has changed: when you click "Save" nothing changes, so nothing seem to happen (but the changes are written in the background). Please go back to the normal page view on Save.

  • Please rename "Exit" back to "Cancel"

  • Please change the "Deployment actions" in the ThompsonThemeBundle also (the ThompsonThemeBundle is included in a default Integrated installation)




Marijn Otte

Epic Link



Fix versions