Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move formactions wrapper into separate block #2580

Closed
wants to merge 1 commit into from

Conversation

SiliconMind
Copy link

This small change helps to add custom action without overwriting whole formactions block. Currently to add new action on edit form we have to rewrite whole formactions block. This small change allows this:

{% extends 'SonataAdminBundle:CRUD:edit.html.twig' %}

{% block formactions %}
    <button type="submit" class="btn btn-success" name="btn_my_action">My action</button>
    {{ parent() }}
{% endblock %}

This helps to add custom action without overwriting whole formactions block
@K-Phoen
Copy link
Contributor

K-Phoen commented Jan 8, 2015

So, what's the status of this PR?

@SiliconMind
Copy link
Author

@K-Phoen Don't ask me - the automated checks errors were not related to my code at all and I can't merge them because I don't have write access to the Sonata repo.

@K-Phoen
Copy link
Contributor

K-Phoen commented Jan 8, 2015

I was more asking this to @rande or @pulzarraider :)

@pulzarraider
Copy link
Contributor

@SiliconMind to make this PR more usable and without BC break I suggest you to leave the old block formactions at the same place. Instead of that please create new prefixed blocks:
sonata_pre_form_actions, sonata_form_actions and sonata_post_form_actions.

So we will have:

{% block formactions %}
   {% block sonata_pre_form_actions %}<div ...{% endblock %}
   {% block sonata_form_actions %}...{% endblock %}
   {% block sonata_post_form_actions %}</div>{% endblock %}
{% endblock %}

@pulzarraider
Copy link
Contributor

Closing in favor of #2919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants