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

Question : How to use the form-theme only for the admin part ? #39

Closed
numerogeek opened this issue Apr 22, 2015 · 5 comments
Closed

Question : How to use the form-theme only for the admin part ? #39

numerogeek opened this issue Apr 22, 2015 · 5 comments

Comments

@numerogeek
Copy link

Hi guys,

I am using this bundle to add an admin part to my app, which have its own form theme for the front end.
This bundle provide an other form-theme, but how to use it only in the admin part ?
I'd like to avoid override my front end form theme.

@ThatCheck
Copy link

You can override the default theme in twig template. So create a base.html.twig which extends all your twig template in front and use the {% form_theme form 'bootstrap_3_layout.html.twig' %} in your base.html.twig

@numerogeek
Copy link
Author

Hi @ThatCheck thx for your reply.
The point is that :
I have specific form theme for the front (injected in the twig configuation) - and I want to use the form theme provided by avanzu only in the back end part.

For now I have used your solution : Overrided the AvanzuAdminThemeBundle:base-layout.html.twig and added
{% if form is defined %}
{% form_theme form 'AvanzuAdminThemeBundle:layout:form-theme.html.twig' %}
{% endif %}

(yeah, because if no form var is setted like in the dashboard, there is an error) but I am asking myself isf there is no more efficient solution.

@avanzu
Copy link
Owner

avanzu commented Aug 31, 2015

you should be able to override the form theme by referencing mulitple templates in order of priority.

@shakaran
Copy link
Collaborator

@numerogeek the issue is resolved and replied to you or you still need more info about this? Please let me know for keep open or close it. Thanks!

@shakaran
Copy link
Collaborator

Add some documentation about, since no reply or more comments, I gonna close this issue. Reopen if you still need some clarification, thanks!

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

No branches or pull requests

4 participants