Hallo zusammen,
ich erweitere gerade ein Plugin, welches im Ordner custom liegt. Es scheint allerdings so zu sein, dass mein Plugin die falsche tpl überschreibt und somit nicht die des zu erweiternden Plugins.
'onPreDispatch',
'Theme_Compiler_Collect_Plugin_Less' => 'onGetLess',
];
}
public function onPreDispatch(Enlight_Event_EventArgs $arguments)
{
$controller = $arguments->getSubject();
$controller->View()->addTemplateDir( __DIR__. '/Views');
$controller->View()->extendsTemplate('frontend/listing/box_article.tpl');
}
/**
* @return ArrayCollection
*/
public function onGetLess()
{
$less = new LessDefinition(
[],
[$this->getPath() . '/Views/frontend/_public/src/less/variationPreview.less'],
$this->getPath()
);
return new ArrayCollection([$less]);
}
public function enable()
{
return [
'success' => true,
'invalidateCache' => ['backend', 'frontend', 'theme']
];
}
public function disable()
{
return [
'success' => true,
'invalidateCache' => ['backend', 'frontend', 'theme']
];
}
}
Ich versuche, die box_article.tpl des Plugins zu überschreiben, glaube aber, dass das extend hier falsch ist bzw. dieses den falschen Pfad nimmt:
{extends file="parent:frontend/listing/box_article.tpl"}
{block name="frontend_listing_box_article_includes"}
{if !$sArticle.tcinn_variants ||
(!$tc_vil_is_enabled_in_sliders && $productBoxLayout == 'slider')}
{$smarty.block.parent}
{else}
{$smarty.block.parent}
{$originalSArticle = $sArticle}
{foreach $originalSArticle.tcinn_variants as $variant}
{$sArticle = $variant}
{$smarty.block.parent}
{/foreach}
{$sArticle = $originalSArticle}
{if $sArticle.tcinn_variant_areas['left']}
{$bar_variant_options = $sArticle.tcinn_variant_areas['left']}
{$bar_config = $tc_vil_bar_configs.left}
{strip}
{$sArticle.tcinn_variant_areas_meta['left']['title']}
{foreach $bar_variant_options as $option}
{if $option.thumbnail}
{else}
{$option.optionname}
{/if}
{/foreach}
{if $sArticle.tc_vil_left_has_plus}
+
{/if}
{/strip}
{/if}
{if $sArticle.tcinn_variant_areas['right']}
{$bar_variant_options = $sArticle.tcinn_variant_areas['right']}
{$bar_config = $tc_vil_bar_configs.right}
{strip}
{foreach $bar_variant_options as $option}
{if $option.thumbnail}
{else}
{$option.optionname}
{/if}
{/foreach}
{if $sArticle.tc_vil_right_has_plus}
+
{/if}
{/strip}
{/if}
{if $sArticle.tcinn_variant_areas['bottom']}
{$bar_variant_options = $sArticle.tcinn_variant_areas['bottom']}
{$bar_config = $tc_vil_bar_configs.bottom}
{strip}
{$sArticle.tcinn_variant_areas_meta['bottom']['title']}
{foreach $bar_variant_options as $option}
{if $option.thumbnail}
{else}
{$option.optionname}
{/if}
{/foreach}
{if $sArticle.tc_vil_bottom_has_plus}
+
{/if}
{/strip}
{/if}
{/if}
{/block}