Search code examples
symfonytwigeasyadmin

How can i only get the body contents of easyAdmin bundle twigs


I want the functionality of EasyAdmin Bundle but i just want the body tag cause i have my own template and i can't seem to be able to extract only the contents of the body tag.

i tried the checking out the code but it keeps referencing other twigs i just want what's inside the body block in html and css

{% extends 'baseback.html.twig' %}

{% block body %}


{% endblock %}

enter image description here

this is what i need from the bundle code."


Solution

  • If you look at the EasyAdmin source code:

    https://github.com/EasyCorp/EasyAdminBundle/blob/master/src/Resources/views/default/layout.html.twig

    You can see that body block contains everything including menus and stuff; where content block is what you want.

    Now in the documentation:

    https://symfony.com/doc/master/bundles/EasyAdminBundle/book/edit-new-configuration.html#overriding-the-default-templates-using-symfony-s-mechanism

    You can override the above layout.html.twig in your own project to only render what you want.