# Shopware 5 backend template extend

**URL:** <https://forum.shopware.com/t/shopware-5-backend-template-extend/89376>\
**Category:** Themes & Design\
**Created:** [23. Juli 2021 um 14:12 UTC](https://forum.shopware.com/t/shopware-5-backend-template-extend/89376 "2021-07-23T14:12:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akarso](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@akarso](https://forum.shopware.com/u/akarso)\
**Post date:** [23. Juli 2021 um 14:12 UTC](https://forum.shopware.com/t/shopware-5-backend-template-extend/89376/1 "2021-07-23T14:12:52Z")

</div>

I’m stuck on a presumably simple task of extending backend template. I’d like to add class to the body depending on user role.

I’ve created a plugin, added subscriber, views folder and tried to extend template backend/base/index.tpl, for starters. I tried using action Enlight\_Controller\_Action\_PostDispatchSecure\_Backend\_Base and Enlight\_Controller\_Action\_PostDispatchSecure\_Backend\_Index then either `$view->extendsTemplate('backend/base/index.tpl');` or `$view->extendsTemplate('backend/index/index.tpl');` respectively, but not much happens. Backend goes blank in first case.

Tried extending extjs templates too, but also to no avail.

Wiring into the event system seems frustratingly difficult. Especially when there is not much info on a topic. I would have to go through the whole function call chain to understand how it exactly works. It is explained in the docs, but apparently I can’t make it work. I’m not even sure how the controller actions are being used here. Can I use Enlight\_Controller\_Action\_PostDispatchSecure\_Backend\_Base to make changes in backend/index/index.tpl? Or should it be Enlight\_Controller\_Action\_PostDispatchSecure\_Backend\_Index?
