Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Blog detail URLs were hardcoded to use blog/ prefix, preventing users migrating from Shopware 5 from maintaining their existing URL structure (e.g., beauty-blog/my-post).

Changes

Configuration

  • Add blogUrlPrefix text field to plugin settings (default: blog)
  • Bilingual labels and help text (EN/DE)

Core Implementation

  • BlogSeoUrlRoute: Inject SystemConfigService and make template generation dynamic based on configured prefix
  • BlogCacheInvalidSubscriber: Listen to system_config.written events and regenerate all blog SEO URLs when prefix changes
  • services.xml: Wire SystemConfigService dependency

Tests

  • Unit tests covering default prefix, custom prefixes, and hyphenated prefixes

Documentation

  • Update README with usage instructions
  • Add changelog entries (EN/DE)

Usage

<!-- Settings → System → OpenBlogware → SEO Meta Configuration -->
<input-field type="text">
    <name>blogUrlPrefix</name>
    <defaultValue>blog</defaultValue>
</input-field>
// BlogSeoUrlRoute.php
private function getTemplate(): string
{
    $prefix = $this->systemConfigService->getString('WerklOpenBlogware.config.blogUrlPrefix');
    if ($prefix === null || $prefix === '') {
        $prefix = 'blog';
    }
    return $prefix . '/{{ entry.blogCategories.first.translated.name|lower }}/{{ entry.translated.slug|lower }}';
}

Changing the prefix automatically regenerates all blog SEO URLs and invalidates caches. Fully backward compatible—existing installations continue using blog/ prefix.

Original prompt

This section details on the original issue you should resolve

<issue_title>Möglichkeit zur Anpassung der Blog-Detail-URL</issue_title>
<issue_description>Hallo liebes OpenBlogware-Team 👋,

erstmal ein großes Lob für dieses tolle Plugin! Die Integration in Shopware 6 funktioniert wirklich gut und macht die Migration von Shopware 5 deutlich einfacher. Vielen Dank für eure Arbeit und dafür, dass ihr dieses Projekt der Community zur Verfügung stellt.

Ich habe eine Frage bzw. einen Feature-Wunsch:
Ist es aktuell möglich (oder könnte es zukünftig ermöglicht werden), die Blog-Detail-URL von „blog/{{ entry.slug }}“ auf z. B. „something-blog/{{ entry.slug }}“ anzupassen?

Hintergrund: Ich migriere gerade von Shopware 5 zu Shopware 6 und möchte meine bisherigen Blog-URLs beibehalten, um SEO-Verluste zu vermeiden und Weiterleitungen zu minimieren.
Ich habe bereits die SEO-URL-Templates in den Shopware-Einstellungen angepasst, aber die Blog-Detailseiten verwenden weiterhin den Standardpfad „blog/{{ entry.slug }}“.

Image

Gibt es hierfür eine Einstellung im Plugin oder einen empfohlenen Weg (z. B. via Routing/SEO-URLs), um einen eigenen Präfix zu setzen?
Vielen Dank vorab für eure Rückmeldung und eure großartige Arbeit!</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 30, 2025 20:49
Co-authored-by: 7underlines <17121556+7underlines@users.noreply.github.com>
Co-authored-by: 7underlines <17121556+7underlines@users.noreply.github.com>
Co-authored-by: 7underlines <17121556+7underlines@users.noreply.github.com>
Co-authored-by: 7underlines <17121556+7underlines@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to customize blog detail URL Add configurable blog URL prefix for SEO migration support Dec 30, 2025
Copilot AI requested a review from 7underlines December 30, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Möglichkeit zur Anpassung der Blog-Detail-URL

2 participants