Dynamische Inhalte: SchemaHelper, strukturierte Mappings, FAQ- und Listen-Funktionen - #18
Open
skerbis wants to merge 1 commit into
Open
Dynamische Inhalte: SchemaHelper, strukturierte Mappings, FAQ- und Listen-Funktionen#18skerbis wants to merge 1 commit into
skerbis wants to merge 1 commit into
Conversation
…sten-Funktionen
- SchemaHelper mit Helfern für Offer, PostalAddress, ContactPoint,
GeoCoordinates, OpeningHoursSpecification, AggregateRating, Brand,
Organization, Person, Place, Question/FAQPage und ItemList inkl.
Normalisierung von Preisen, Verfügbarkeiten, Wochentagen und Uhrzeiten
- Organization-/LocalBusiness-Teilobjekte im Generator auf SchemaHelper
konsolidiert
- Strukturierte Feld-Zuordnung ("nested"/"opening_hours") für dynamische
URL-Profile in beiden Auflösungspfaden, Backend-UI mit Unterfeldern,
Öffnungszeiten-Zeilen und verschachtelter Vorschau, serverseitige
Bereinigung der Mappings beim Speichern
- FAQPage aus der Typauswahl entfernt (Bestand bleibt mit Hinweis
bearbeitbar); jsonld_render_faq(), jsonld_render_item_list() und
jsonld_render_schema() als Template-Funktionen (DynamicContent)
- README und CHANGELOG ergänzt
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hallo Oli,
dieser PR erweitert das AddOn für dynamische Inhalte aus YForm-Tabellen (Produkte, FAQ, Events, Standorte, Listen). Ausgangspunkt war, dass
ProductundFAQPagein der Typauswahl der dynamischen URLs zwar angeboten werden, das Ergebnis aber kein valides Markup ergab:offerswurde als flacher Wert statt alsOffer-Objekt ausgegeben, undFAQPagekann mit dem „1 Datensatz = 1 Schema“-Mechanismus grundsätzlich keinmainEntity-Array aus mehreren Zeilen bilden.Was drin ist
SchemaHelper (
lib/SchemaHelper.php)Statische Helfer für valide Teilobjekte:
offer(),openingHoursSpecification(),postalAddress(),contactPoint(),geoCoordinates(),aggregateRating(),brand(),organization(),person(),place(),question(),faqPage(),itemList(),withType(). Preise (12,50 €→12.50), Verfügbarkeiten (InStock,ja/nein,1/0→ Schema.org-URL), Wochentage (Mo,Montag→Monday) und Uhrzeiten werden normalisiert. Die bisher mehrfach handgebautenPostalAddress/ContactPoint/GeoCoordinates-Arrays für Organization und LocalBusiness im Generator laufen jetzt darüber.Strukturierte Feld-Zuordnung für dynamische URL-Profile (
lib/Mapping/DynamicFieldMapper.php)Neben
field/staticgibt es zwei neue Mapping-Formate:{"type":"nested","fields":{"price":{"type":"field","value":"preis"},"priceCurrency":{"type":"static","value":"EUR"}}} {"type":"opening_hours","rows":[{"days":["Monday","Friday"],"opens":{"type":"field","value":"mo_von"},"closes":{"type":"field","value":"mo_bis"}}]}Unterstützte Properties:
offers,brand,aggregateRating,address,contactPoint,location(Place),organizer/provider(Organization),author(Person),openingHoursSpecification. Beide Auflösungspfade (DynamicJsonLd.phpundJsonLdGenerator::generateDynamicSchema()) nutzen dieselbe Klasse. Bestehende flache Mappings bleiben unverändert.Backend-UI (
pages/dynamic_urls_edit.php)Für diese Properties gibt es die Option „Strukturiert“, die Unterfelder einblendet (jeweils Feld oder statischer Wert); Öffnungszeiten haben einen Zeilen-Editor mit Wochentagen. Die Vorschau zeigt das verschachtelte Ergebnis. Beim Speichern werden Mappings serverseitig auf bekannte Formate sowie gültige Property- und Spaltennamen reduziert. Nebenbei: die Vorschau zeigte bisher nie Beispielwerte, weil
sampleDataals Objekt mit.lengthabgefragt wurde.FAQPage
Aus der Typauswahl entfernt; bestehende Zuordnungen bleiben mit Warnhinweis bearbeitbar. Stattdessen gibt es eine Template-Funktion, die alle passenden Zeilen zu einem Schema zusammenfasst.
Template-Funktionen für mehrzeilige Inhalte (
lib/DynamicContent.php)Filter sind Spalte-Wert-Paare (Prepared Statements, Arrays →
IN,null→IS NULL), Tabellen-, Spalten- undorder_by-Angaben werden validiert. Debug-Overlay wird bedient.Weitere Properties in der Auswahl:
Product.aggregateRating/url,LocalBusiness.openingHoursSpecification/url/priceRange,Event.offers/url,Service.offers. README und CHANGELOG (Abschnitt „Unreleased“, keine Versionsanhebung) sind ergänzt.Bewusst nicht angefasst
Mapping/DataSource.php).jsonld_render()undgenerateDynamicJsonLd(), siehe Dynamische URLs: Schema für denselben Datensatz wird doppelt ausgegeben #17.Verhaltensänderungen
GeoCoordinateswerden nur noch ausgegeben, wenn Breiten- und Längengrad numerisch und ungleich 0 sind (vorher wurde jeder nicht-leere String durchgereicht).Geprüft
DynamicContentgegen eine temporäre DB-Tabelle, alle grün.node --check.Viele Grüße
Thomas
🤖 Generated with Claude Code