承接 in-square/opendxp-seo-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

in-square/opendxp-seo-bundle

最新稳定版本:v1.0.5

Composer 安装命令:

composer require in-square/opendxp-seo-bundle

包简介

Seo bundle for OpenDXP

README 文档

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'

Hreflang x-default language

By default, x-default points to the URL of OpenDXP defaultLanguage. You can override this behavior by setting a preferred language for x-default. If the configured language version does not exist for a given page/object, the bundle falls back to OpenDXP defaultLanguage.

in_square_opendxp_seo:
    hreflang:
        x_default_language: 'en'

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');
}

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固