Running a website · Advanced · 1:27 min
Connecting external sources
Fetch RSS, JSON, XML or OpenImmo regularly and show it as entries of a data table.
Goal
You bring content from an external source into a data table – with field mapping, preview and schedule.
Prerequisites
- Permission “manage external sources” and the external sources feature (switched on by the network/agency).
- The address of the source (URL) or a file, e.g. an OpenImmo ZIP from estate-agent software.
Step by step
Transcript: every step matches one subtitle in the video.
- Data › Externe Quellen (external sources): RSS feeds, JSON APIs, XML and OpenImmo as entries of a data table.
- Visitors never load anything from the source: list, detail page, search and API come from your own table.
- Templates to start with: RSS/Atom, OpenImmo, JSON API or XML with XPath.
- The example “Immobilien” (real estate) reads an OpenImmo file from estate-agent software.
- Source: name, format and address – or upload the file on the right. Credentials are stored encrypted.
- Fetching: schedule, cache and what happens to entries missing from the source.
- Mapping: every table field gets a path in the source – with a conversion, e.g. number or date.
- “Vorschau & Test” (preview & test) shows the first entries as they would arrive in the table – without saving.
- On the right: status, “Jetzt abrufen” (fetch now) and the log of recent fetches.
- Imported entries are in “Immobilien” – read-only, because the source maintains them.
Commands & configuration
*/15 * * * * php bin/console sources:sync --all # Zeitplan zuverlässig per Cronjob
Tips & pitfalls
Tip
The template can create the matching data table with its detail page right away (Tabelle … anlegen).
Tip
Images from the source end up in the media library – re-encoded and without EXIF (collection “Quelle: …”).
Watch out
Do not edit entries from a source by hand – the next fetch overwrites them. Put your own additions in separate fields or tables.
Watch out
Clarify usage rights: content from third-party feeds must not be published automatically.