twigshopware

Is it possible to extend same twig template twice by two separate plugins in Shopware 6 administration?


I want to add field to administration template (src/Administration/Resources/app/administration/src/module/sw-sales-channel/view/sw-sales-channel-detail-base/sw-sales-channel-detail-base.html.twig) but I've noticed that another custom plugin is doing it already.

Is it possible for me to add my field (following this tutorial https://docs.shopware.com/en/shopware-platform-dev-en/how-to/add-admin-new-field) alongside changes from exisitng plugin?

Or the plugin which comes first will apply changes to the component template and the other template will be ommited?


Solution

  • This should be possible if you both use the {% parent %} method inside the block.

    It will insert the date/template defined in the parent template.