Frontend Templates überschreiben via Plugin ohne Theme? Windows Problem?

Ich kann dir gern zeigen, wie ich das gemacht habe und wie es bei mir funktioniert. Um dieses Template zu manipulieren, verwende ich (u.a.) folgende Struktur:

/SW_ROOT_FOLDER/custom/plugins/PluginName/

|___ Resources/

      |___ views

            |___ frontend/

                  |___ detail/

                         |___ content/

                                |___ buy_container.tpl

      |___ services.xml

|___ Subscriber/

      |___ RouteSubscriber.php

|___ PluginName.php

Die Dateien sind wie folgt aufgebaut.

buy_container.tpl:

{extends file="parent:frontend/detail/content/buy_container.tpl"}

{block name='frontend_detail_data_attributes'}
    {$smarty.block.parent}

    [mein inhalt]

{/block}

services.xml:

            %plugin_name.plugin_name%
            %plugin_name.plugin_dir%

RouteSubscriber.php:

 'onPostDispatch',
        ];
    }

    public function __construct($pluginName, $pluginDirectory)
    {
        $this->pluginDirectory = $pluginDirectory;
    }

    public function onPostDispatch(\Enlight_Controller_ActionEventArgs $args)
    {
        /** @var \Enlight_Controller_Action $controller */
        $controller = $args->get('subject');
        $view = $controller->View();

        $view->addTemplateDir($this->pluginDirectory . '/Resources/views');

        $request = $controller->Request();
        $response = $controller->Response();


    }
}

PluginName.php:

 

1 „Gefällt mir“