Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
/runner/node_modules
/runner/.env
/runner/.env.local

.DS_Store
.idea
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Types of changes
Security in case of vulnerabilities.
)

## [1.1.0](https://github.com/pdir/contao-seo-plugin/tree/1.1.0) - 2025-04-24

- [Added] Adds FAQ schema.org JSON-LD feature from marked content elements
- [Added] Compatibility with Contao 5.6 and 5.7
- [Removed] Contao 4.13 and Symfony 5 support

## [1.0.3](https://github.com/pdir/contao-seo-plugin/tree/1.0.3) - 2024-11-09

- [Fixed] do not use global namespace in OutputFrontendTemplateListener
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pdir/contao-seo-plugin",
"description": "SEO plugin for Contao CMS",
"keywords":["seo", "indexnow","marketing","ranking","pagespeed", "contao", "search engine optimization", "onpage", "content", "tips", "alias", "404", "redirects", "witerleitung"],
"keywords":["seo", "indexnow","marketing","ranking","pagespeed", "contao", "search engine optimization", "onpage", "content", "tips", "alias", "404", "redirects", "witerleitung", "faq schema.org", "JSON-LD"],
"license":"LGPL-3.0-or-later",
"type": "contao-bundle",
"authors": [
Expand All @@ -19,11 +19,11 @@
},
"require": {
"php": "^8.1",
"contao/core-bundle": "^4.13 || ^5.0",
"contao/core-bundle": "^5.3",
"pdir/contao-webtools": "^1.5",
"symfony/config": "^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
"symfony/config": "^6.4 || ^7.4",
"symfony/dependency-injection": "^6.4 || ^7.4",
"symfony/http-kernel": "^6.4 || ^7.4",
"terminal42/contao-url-rewrite": "^1.7",
"composer-runtime-api": "^2.1"
},
Expand Down
2 changes: 1 addition & 1 deletion config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pdir_contao_seo.controller:
resource: ../src/Controller
type: annotation
type: attribute
2 changes: 2 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:

pdir.contao_seo_plugin.listener.generate_page:
class: Pdir\ContaoSeoPlugin\EventListener\GeneratePageListener
arguments:
$injectionLocation: '%pdir_contao_seo.faq_schema_injection_location%'

pdir.contao_seo_plugin.listener.data_container.backend_usability:
class: Pdir\ContaoSeoPlugin\EventListener\DataContainer\BackendUsabilityListener
Expand Down
2 changes: 1 addition & 1 deletion contao/dca/tl_calendar_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
16 changes: 16 additions & 0 deletions contao/dca/tl_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$GLOBALS['TL_DCA']['tl_content']['fields']['contaoSeoAddFaqSchema'] = [
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'clr', 'submitOnChange'=>true],
'sql' => ['type' => 'boolean', 'default' => false]
];

$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'contaoSeoAddFaqSchema';

foreach ($GLOBALS['TL_DCA']['tl_content']['palettes'] as $key => $palette) {
if (is_string($palette) && $key !== '__selector__') {
$GLOBALS['TL_DCA']['tl_content']['palettes'][$key] .= ';{contao_seo_legend},contaoSeoAddFaqSchema';
}
}
2 changes: 1 addition & 1 deletion contao/dca/tl_news.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion contao/dca/tl_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion contao/dca/tl_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion contao/dca/tl_user_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
6 changes: 6 additions & 0 deletions contao/languages/de/tl_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

declare(strict_types=1);

$GLOBALS['TL_LANG']['tl_content']['contao_seo_legend'] = 'SEO Einstellungen';
$GLOBALS['TL_LANG']['tl_content']['contaoSeoAddFaqSchema'] = ['Als FAQ ausgeben', 'Dieses Element in strukturierte FAQ-Daten aufnehmen'];
2 changes: 1 addition & 1 deletion contao/languages/de/tl_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion contao/languages/de/tl_user_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
6 changes: 6 additions & 0 deletions contao/languages/en/tl_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

declare(strict_types=1);

$GLOBALS['TL_LANG']['tl_content']['contao_seo_legend'] = 'SEO - Settings';
$GLOBALS['TL_LANG']['tl_content']['contaoSeoAddFaqSchema'] = ['Display as FAQ', 'Include this item in structured FAQ data'];
2 changes: 1 addition & 1 deletion contao/languages/en/tl_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion contao/languages/en/tl_user_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/IndexNowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/IndexNowTxtController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
41 changes: 41 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
* @license LGPL-3.0-or-later
* @author pdir GmbH <https://pdir.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Pdir\ContaoSeoPlugin\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('pdir_contao_seo');

$treeBuilder
->getRootNode()
->children()
->enumNode('faq_schema_injection_location')
->values(['head', 'body'])
->defaultValue('head')
->end()
->end();

return $treeBuilder;
}
}
12 changes: 9 additions & 3 deletions src/DependencyInjection/PdirContaoSeoPluginExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand All @@ -20,15 +20,21 @@

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

class PdirContaoSeoPluginExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../../config'));
$config = $this->processConfiguration(new Configuration(), $configs);

$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));

$loader->load('controller.yaml');
$loader->load('services.yaml');

$container->setParameter('pdir_contao_seo.faq_schema_injection_location', $config['faq_schema_injection_location']
);
}
}
2 changes: 1 addition & 1 deletion src/EventListener/DataContainer/AliasSaveListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/DataContainer/BackendListenerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/DataContainer/PageListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* pdir contao seo plugin for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
* Copyright (c) 2026 pdir / digital agentur // pdir GmbH
*
* @package contao-seo-plugin
* @link https://pdir.de/contao-seo-plugin
Expand Down
Loading