Verwendung: Wie kann ich beim Oneo-Theme die JSON-LD-Daten anpassen

office's Avatar

office

30 Jul, 2026 10:00 AM

Produkt: Oneo Contao
Contao-Version: 5.3.

im Code sind sie vorhanden, ich finde aber im fe_page Template keine Codezeile, wo der Code eingefügt wird.

  1. Support Staff 1 Posted by RockSolid Theme... on 30 Jul, 2026 11:37 AM

    RockSolid Themes's Avatar

    Vielen Dank für Ihre Frage.

    Die JSON-LD-Daten werden im fe_page.html5-Template von Contao selbst auf Zeile 100 ausgegeben: https://github.com/contao/contao/blob/51dd405c9962ae6c081fcff15eaf555365e25bba/core-bundle/contao/templates/frontend/fe_page.html5#L100

    Diese Ausgabe sollten Sie jedoch nicht im Template anpassen, ansonsten könnte es zu Problemen bei zukünftigen Updates kommen.

    Nutzen Sie stattdessen $this->getSchemaOrgData() und $this->addSchemaOrg() in Ihrem Template, Beispiel: https://github.com/contao/contao/blob/51dd405c9962ae6c081fcff15eaf555365e25bba/calendar-bundle/contao/templates/events/event_full.html5#L48-L63

    Je nach Anwendungsfall können Sie stattdessen auch einen Event-Listener erstellen und über den Service contao.routing.response_context_accessor mit ->getResponseContext()->get(JsonLdManager::class)->getGraphForSchema(JsonLdManager::SCHEMA_ORG)->set(…) die Daten entsprechend anpassen.

  2. 2 Posted by office on 30 Jul, 2026 11:44 AM

    office's Avatar

    Vielen Dank für die Rückmeldung.
    Im fe_page.html der Oneo-Templates habe ich den Eintrag nämlich nicht gefunden...
    Meine Onepager-Theme verwendet aber das Oneo-Seiten-Template, wieso wird in dem Fall dann trotzdem auf das Contao fe_page.html Seitentemplate zugegriffen?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac