SEO Bundle
The SEO Bundle in CoreShop provides tools and services to enhance the search engine optimization capabilities of your site. It is designed to work seamlessly with Pimcore's HeadLink and HeadMeta helpers.
Installation Process
To install the SEO Bundle, use Composer:
$ composer require coreshop/seo-bundle:^4.0
Activating the Bundle
Enable the bundle inside the kernel or use the Pimcore Extension Manager:
<?php
// app/AppKernel.php
public function registerBundlesToCollection(BundleCollection $collection)
{
$collection->addBundles([
new \CoreShop\Bundle\SEOBundle\CoreShopSEOBundle(),
]);
}
Usage
Updating SEO Information
Utilize the coreshop.seo.presentation
service to update SEO metadata:
// From a Controller
$this->get('coreshop.seo.presentation')->updateSeoMetadata($object);
Implementing SEO Interfaces
The SEO Bundle includes several interfaces:
CoreShop\Component\SEO\Model\SEOAwareInterface
: For meta-title and meta-description.CoreShop\Component\SEO\Model\SEOImageAwareInterface
: For the og-image attribute.CoreShop\Component\SEO\Model\SEOImageAwareInterface
: For og-title, og-type, and pg-description attributes.
Implementing SEO Extractors
To create a custom extractor, implement the ExtractorInterface
and register it with the tag coreshop.seo.extractor
.