_Elena__Elena_ MemberComments: 1 Received thanks: 0 Member since: October 2016 edited October 2016

Good evening,

in a plugin with 5.2 system, I would like to edit the template used in the slider, for example in a page with this url:

http://mypersonal.site/widgets/emotion/productStreamArticleSlider/streamId/1/productBoxLayout/slider?start=0&limit=6

The template folder "Resources/view" is loaded (because other *.tpl in the plugins are loaded), but if I extend "frontend/_includes/product_slider_items.tpl" in my plugin, the system loads the original "product_slider_items.tpl" in Bare theme instead. I already cleared the cache and compiled the theme but it still doesn't load.

Any clues on how can I modify "product_slider_items.tpl" in my own plugin?

Edit

I tried to user productBoxLayout parameter and choose my own template in frontend/listing/box_article.tpl, the parameter is passed, but I have the same problem: box_article.tpl of the plugin is not loaded!

My frontend/listing/box_article.tpl is this:

{extends file="parent:frontend/listing/box_article.tpl"}

{block name="frontend_listing_box_article_includes_additional"}   
    {if $productBoxLayout == 'myslider'}
        {include file="frontend/listing/product-box/box-myslider.tpl"}
    {else}
        {include file="frontend/listing/product-box/box-basic.tpl" productBoxLayout="basic"}
    {/if}
{/block}

Solved

In getSubscribedEvents() I called Enlight_Controller_Action_PostDispatchSecure instead of Enlight_Controller_Action_PostDispatchSecure_Frontend because the sliders are under Widgets and not Frontend, I don't specify Widget because I also need to trigger the templates for the frontend:

public static function getSubscribedEvents()
    {
        return array(
            'Enlight_Controller_Action_PostDispatchSecure' => 'addTemplateDir',
        );
    }

 

Sign In or Register to comment.