sBanner example

/** @var StoreFrontEmotionDeviceConfiguration $service */
        $service = $this->get(\Shopware\Bundle\EmotionBundle\Service\StoreFrontEmotionDeviceConfigurationInterface::class);
        $emotions = $service->getCategoryConfiguration($categoryId$context);

        $categoryContent = Shopware()->Modules()->Categories()->sGetCategoryContent($categoryId);

        $this->View()->assign([
            'hasCustomerStreamEmotion' => $this->container->get(\Shopware\Models\CustomerStream\CustomerStreamRepositoryInterface::class)->hasCustomerStreamEmotions($categoryId),
            'emotions' => $emotions,
            'hasEmotion' => !empty($emotions),
            'sCategoryContent' => $categoryContent,
            'sBanner' => Shopware()->Modules()->Marketing()->sBanner($categoryId),
        ]);
    }

    /** * Handle theme preview hash * * @return bool */
    private function handleThemeHash()
    {
        $hash = $this->Request()->getParam('themeHash');

        
        if (empty($categoryContent) || !$categoryContent['blog']) {
            throw new Enlight_Controller_Exception(sprintf('Blog category by id "%d" is invalid', $categoryId), 404);
        }

        if (!empty($categoryContent['external'])) {
            $this->redirect($categoryContent['external']['code' => 301]);

            return;
        }

        $assigningData = [
            'sBanner' => $this->get('modules')->Marketing()->sBanner($categoryId),
            'sBreadcrumb' => $this->getCategoryBreadcrumb($categoryId),
            'sCategoryContent' => $categoryContent,
            'sNumberArticles' => $totalResult,
            'sPage' => $page,
            'sPerPage' => $perPage,
            'sFilterDate' => $this->getDateFilterData($blogCategoryIds$filter$shopId),
            'sFilterAuthor' => $this->getAuthorFilterData($blogCategoryIds$filter$shopId),
            'sFilterTags' => $this->getTagsFilterData($blogCategoryIds$filter$shopId),
            'sCategoryInfo' => $categoryContent,
            'sBlogArticles' => $blogArticles,
            'sNumberPages' => (int) ceil($totalResult / $perPage),
        ];
public function layoutAction(Request $request)
    {
        $this->View()->loadTemplate('frontend/listing/customer_stream/layout.tpl');

        $categoryId = (int) $request->getParam('sCategory');

        $categoryContent = Shopware()->Modules()->Categories()->sGetCategoryContent($categoryId);

        $config = $this->getEmotionConfiguration($categoryId, true, $categoryContent['streamId'] ?? null);

        $config = array_merge($config[
            'sBanner' => Shopware()->Modules()->Marketing()->sBanner($categoryId),
            'sCategoryContent' => $categoryContent,
            'Controller' => 'listing',
            'params' => $this->Request()->getParams(),
        ]);

        $this->View()->assign($config);
    }

    /** * @return void */
    
Home | Imprint | This part of the site doesn't use cookies.