getMetaDescription example

// prepare form data for view         $formData = [
            'id' => (string) $form->getId(),  // intended string cast to keep compatibility             'active' => $form->getActive(),
            'name' => $form->getName(),
            'text' => $form->getText(),
            'text2' => $form->getText2(),
            'email' => $form->getEmail(),
            'email_template' => $form->getEmailTemplate(),
            'email_subject' => $form->getEmailSubject(),
            'metaTitle' => $form->getMetaTitle(),
            'metaDescription' => $form->getMetaDescription(),
            'metaKeywords' => $form->getMetaKeywords(),
            'attribute' => $attributeArray,
        ];

        return array_merge($formData[
            'sErrors' => $this->_errors,
            'sElements' => $this->_elements,
            'sFields' => $fields,
            'sLabels' => $labels,
        ]);
    }

    
if ($media && !\array_key_exists('path', $media)) {
            $media['path'] = $media['source'];
        }

        $data = [
            'id' => $category->getId(),
            'parentId' => $category->getParentId(),
            'name' => $category->getName(),
            'position' => $category->getPosition(),
            'metaTitle' => $category->getMetaTitle(),
            'metaKeywords' => $category->getMetaKeywords(),
            'metaDescription' => $category->getMetaDescription(),
            'cmsHeadline' => $category->getCmsHeadline(),
            'cmsText' => $category->getCmsText(),
            'active' => true,
            'template' => $category->getTemplate(),
            'productBoxLayout' => $this->getProductBoxLayout($category),
            'blog' => $category->isBlog(),
            'path' => $categoryPath,
            'external' => $category->getExternalLink(),
            'externalTarget' => $category->getExternalTarget(),
            'hideFilter' => !$category->displayFacets(),
            'hideTop' => !$category->displayInNavigation(),
            
/** * Converts the provided manufacturer to the category seo data structure. * Result can be merged with "sCategoryContent" to override relevant seo category data with * manufacturer data. * * @return array{metaDescription: string, metaKeywords: string, canonicalParams: array{sViewport: string, sAction: string, sSupplier: int}, metaTitle: string, title: string, productBoxLayout: string} */
    private function getSeoDataOfManufacturer(Manufacturer $manufacturer): array
    {
        $content = [];

        $content['metaDescription'] = $manufacturer->getMetaDescription();
        $content['metaKeywords'] = $manufacturer->getMetaKeywords();

        $canonicalParams = [
            'sViewport' => 'listing',
            'sAction' => 'manufacturer',
            'sSupplier' => $manufacturer->getId(),
        ];

        $content['canonicalParams'] = $canonicalParams;
        $content['metaTitle'] = $manufacturer->getMetaTitle();
        $content['title'] = $manufacturer->getName();
        
'helperId' => $site->getId(),
            'iconCls' => $iconCls,
            'tpl1variable' => $site->getTpl1Variable(),
            'tpl1path' => $site->getTpl1Path(),
            'tpl2variable' => $site->getTpl2Variable(),
            'tpl2path' => $site->getTpl2Path(),
            'tpl3variable' => $site->getTpl3Variable(),
            'tpl3path' => $site->getTpl3Path(),
            'description' => $site->getDescription(),
            'pageTitle' => $site->getPageTitle(),
            'metaKeywords' => $site->getMetaKeywords(),
            'metaDescription' => $site->getMetaDescription(),
            'html' => $site->getHtml(),
            'grouping' => $site->getGrouping(),
            'position' => $site->getPosition(),
            'link' => $site->getLink(),
            'target' => $site->getTarget(),
            'shopIds' => $site->getShopIds(),
            'changed' => $site->getChanged(),
            'parentId' => $site->getParentId(),
            'leaf' => true,
        ];

        
'type' => $category->getMedia()->getType(),
                'extension' => $category->getMedia()->getExtension(),
            ];
        }

        $path = $category->getPath() ? '|' . implode('|', $category->getPath()) . '|' : '';

        return [
            'id' => $category->getId(),
            'name' => $category->getName(),
            'metaKeywords' => $category->getMetaKeywords(),
            'metaDescription' => $category->getMetaDescription(),
            'cmsHeadline' => $category->getCmsHeadline(),
            'cmsText' => $category->getCmsText(),
            'active' => true,
            'template' => $category->getTemplate(),
            'blog' => $category->isBlog(),
            'path' => $path,
            'external' => $category->getExternalLink(),
            'externalTarget' => $category->getExternalTarget(),
            'hideFilter' => !$category->displayFacets(),
            'hideTop' => !$category->displayInNavigation(),
            'hidetop' => !$category->displayInNavigation(),
            
throw new PageNotFoundException($landingPageId);
        }

        $page = $this->genericPageLoader->load($request$context);
        $page = LandingPage::createFrom($page);

        $page->setLandingPage($landingPage);

        $metaInformation = new MetaInformation();
        $metaTitle = $landingPage->getMetaTitle() ?? $landingPage->getName();
        $metaInformation->setMetaTitle($metaTitle ?? '');
        $metaInformation->setMetaDescription($landingPage->getMetaDescription() ?? '');
        $metaInformation->setMetaKeywords($landingPage->getKeywords() ?? '');
        $page->setMetaInformation($metaInformation);

        $this->eventDispatcher->dispatch(
            new LandingPageLoadedEvent($page$context$request)
        );

        return $page;
    }
}
Home | Imprint | This part of the site doesn't use cookies.