belsignum/booster
Composer 安装命令:
composer require belsignum/booster
包简介
Schema.org structured data for Typo3 and Google APIs
README 文档
README
Schema.org Structured Data extension for TYPO3.
Requirements
- TYPO3
^12.4 - PHP version compatible with your TYPO3 v12 setup
- PHP extension
ext-json - Composer package
brotkrueml/schema(^3.13.0)
Installation
Install the extension via Composer and activate it in TYPO3.
composer require belsignum/booster vendor/bin/typo3 database:updateschema vendor/bin/typo3 cache:flush
For this project setup, belsignum/booster is loaded from packages/booster.
Scope
The extension provides page-related Structured Data handling for:
- FAQ (
FAQPage) - Product (
Product) - Custom JSON-LD (free-form, per page)
- FAQ accordion plugin (
plugin.tx_booster_faq)
It also includes frontend JSON-LD rendering via PreProcessHook.
Editor (Backend)
Creating Structured Data:
- Open the target page and go to
Page Properties->Structured Data. - Maintain FAQ entries in
tx_booster_faqs. - Maintain Product entry in
tx_booster_product. - Maintain free-form JSON-LD in
tx_booster_custom_jsonld(see below). - Use the
Google Rich Results Testbutton to validate the current page in Google's external tool (new browser tab). - For localized pages, use TYPO3 localization/synchronization actions in the same tab.
Custom JSON-LD
The Custom JSON-LD field accepts a single JSON-LD object or an array of objects. It is rendered as a t3editor instance with JSON syntax highlighting.
To register multiple entities at once, wrap them in square brackets and separate them with commas:
[
{ "@context": "https://schema.org", "@type": "Organization", "name": "Example" },
{ "@context": "https://schema.org", "@type": "WebSite", "url": "https://example.com" }
]
Each top-level entity in the array will be emitted as its own <script type="application/ld+json"> tag in the page head, which is the form Google recommends.
Validation on save (DataHandler hook CustomJsonLdValidator):
- Empty value is accepted.
- Invalid JSON is rejected; the previous value is restored and an error FlashMessage is shown.
- Valid JSON is canonicalized to a pretty-printed (unminified) representation before being stored, so the field stays readable in the backend.
- A soft warning FlashMessage is emitted if any top-level entity is missing
@contextor@type. The value is still saved.
Frontend rendering (PreProcessHook::emitCustomJsonLd):
- Reads the stored field for the current (language-resolved) page UID.
- Splits a top-level JSON array into one
<script type="application/ld+json">tag per entity (Google recommends separate tags per entity). - Emits minified JSON via
json_encode($entity, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG).JSON_HEX_TAGneutralizes any</>inside string values, so a stray</script>substring in user content cannot break out of the surrounding tag. - Suppressed when the page has
no_index > 0, identical to the existing FAQ/Product output. - Bypasses
brotkrueml/schema'sSchemaManager(which only supports typed schema models) and writes directly viaPageRenderer::addHeaderData.
Google Rich Results validator button
The button is rendered by the custom FormEngine node boosterRichResultsLink (registered in ext_localconf.php). It builds the frontend URL via \TYPO3\CMS\Backend\Routing\PreviewUriBuilder with the current sys_language_uid, URL-encodes it, and links to https://search.google.com/test/rich-results?url=<encoded-fe-url> in a new tab.
For new (unsaved) pages or pages without a resolvable preview URL, the button is replaced with a hint asking the editor to save first. The validator only accepts publicly reachable URLs.
FAQ Accordion Plugin
- Add a content element via
Plugins -> FAQ Accordions from Structured Data. - The plugin renders the FAQ list attached to the current page.
- FAQ ordering follows the MM sorting (
tx_booster_pages_content_mm).
Localization import bug with l10nmgr (from 12.2 fixed by default)
The localization relation issue is fixed from Booster version 12.2 onward:
- Correct
l18n_parenttable mapping fortx_booster_domain_model_content. - Localization-aware TCA setup for page fields:
tx_booster_faqstx_booster_product
- Support for language synchronization/localization of inline children.
For existing installations with legacy data, run the repair command once.
CLI Repair Command (Legacy Data)
To repair existing localized relations created before the fix:
vendor/bin/typo3 booster:structured-data:repair-localization --dry-run
Run actual repair:
vendor/bin/typo3 booster:structured-data:repair-localization
Optional filters:
vendor/bin/typo3 booster:structured-data:repair-localization --dry-run --page=3662 vendor/bin/typo3 booster:structured-data:repair-localization --dry-run --language=9
belsignum/booster 适用场景与选型建议
belsignum/booster 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 04 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「search」 「google」 「seo」 「JSON-LD」 「schema.org」 「TYPO3 CMS」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 belsignum/booster 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 belsignum/booster 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 belsignum/booster 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package to retrieve data from Google Search Console
Indexed Search Autocomplete - Extends the TYPO3 Core Extension Indexed_Search searchform with an autocomplete feature.
Help to manage meta data on Laravel Eloquent model
Abstraction Layer to index and search entities
Statamic Fine Seo addon
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2024-04-09