in-square/opendxp-seo-bundle

Seo bundle for OpenDXP

Maintainers

Package info

github.com/in-square/opendxp-seo-bundle

Type:opendxp-bundle

pkg:composer/in-square/opendxp-seo-bundle

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.4 2026-04-21 18:22 UTC

This package is not auto-updated.

Last update: 2026-04-21 18:23:40 UTC


README

Seo package that allows you to complete metadata very quickly

Installation

composer require in-square/opendxp-seo-bundle

in the config/bundles.php file add

return [
    // another bundles
    InSquare\OpendxpSeoBundle\InSquareOpendxpSeoBundle::class => ['all' => true],
];

in the config/packages/in_square_opendxp_seo.yaml file add

Basic configuration

in_square_opendxp_seo: ~

Meta image thumbnail

Set thumbnail_name to an existing image thumbnail definition from OpenDXP.

in_square_opendxp_seo:
    thumbnail_name: 'meta_tag_image'

Title pattern

in_square_opendxp_seo:
    title_pattern:
        before: 'Content before seo title'
        after: 'content after seo title'

Usage

in base template add

<head>
    {{ render_seo_tags() }}
</head>

Document

Just complete the fields in the SEO section and create (optional) a custom property named meta_tag_image with the asset for the document.

If you want to provide keywords, use document property seo_keywords (text). This bundle also provides seo_keywords as a predefined property for documents.

in controller add

public function defaultAction(DocumentSeoMetaGenerator $seoMetaGenerator): Response
{
    $seoMetaGenerator->generate($this->document);

    return $this->render('default/default.html.twig');
}

Object

An interface should be added to the object definition \InSquare\OpendxpSeoBundle\Model\ObjectSeoInterface

Then, according to the interface(\InSquare\OpendxpSeoBundle\Model\ObjectSeoInterface), create the necessary fields

  • seoTitle (text->input)
  • seoDescription (text->textarea)
  • seoKeywords (text->input)
  • seoImage (media->image)

in controller

public function seoObjectAction(ObjectSeoMetaGenerator $seoMetaGenerator): Response
{
    /**
     * @var ObjectSeoInterface $test
     */
    $test = Test::getById(1);
    $url = 'absolute url to this object';

    $seoMetaGenerator->generate($test, $url);

    return $this->render('default/default.html.twig');
}