Closed manuelj555 closed 9 years ago
I personnally don't see what you want, do you have a "real" case to explain more concretely what you need?
@manuelj555 I don't plan to add that feature because embedding a backend inside another backend looks an edge case to me.
However, there are multiple solutions to this problem. You could create a controller that extends from AdminController
(as explained here: https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/6-customizing-new-edit-views.md#customize-the-actions-used-to-create-and-edit-entities) and override the indexAction method to set the id
or any other attribute in the user session.
You could also override the templates of the backend (or just the layout.html.twig
template) to add, remove or tweak the request parameters variable. Soon this will be very easy to do it, once we release the new stable version (read https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/10-customizing-design.md).
PS: there is no need to translate the question into Spanish. English is the only supported language for this bundle :) (I translated a reply once because it seemed that the user didn't speak English).
@Pierstoval I have a entity Product with a relation OneToMany to ProductValue. the idea is to list, add and edit the ProductValues from a specific Value.
Then as @javiereguiluz said, if you can wait until next release (or if you use the dev-master
version), you will be able to override any template, so you can just override the views only for your Product
entity, and also override the form (template and action in controller), but as Javier said, it's kind of a tricky feature, as it would be in a "classic" back-end ;)
Closing it for now for being considered as an edge case. We'll reconsider it in the future. Thanks @manuelj555 for proposing this feature and please, continue reporting bugs and proposing new ideas. Thanks!
Is possible to set additional parameters that are always sent (persistent) for certain entities?
I want to handle an admin as the son of another admin, so I need to get and keep the id of the parent entity in the url, and it occurred to me that sending that id by GET I can read it to filter the records (overwriting the findAll method) .
But the url generated by different list views, edit, new, etc. not take into account this parameter to the url forwarding.
So my question is, do you have in mind adding support for something in the short term ?.
(In Spanish, just in case)
Es posible establecer parametros adicionales que siempre sean enviados (persistent) para algunas entidades?
Quiero poder manejar un admin como hijo de otro admin, por lo que necesito tener y mantener el id de la entidad padre en la url, y se me ocurrió que enviando ese id por GET puedo leerlo para filtrar los registros (sobreescribiendo el método findAll).
Pero las url generadas por las diferentes vistas de list, edit, new, etc. no toman en cuenta este parametro para reenviarlo en la url.
Entonces, mi pregunta es si ¿tienen en mente añadir soporte para algo así en el corto plazo?.