Skip to content

Data Sources

Data sources are the pipelines that deliver content to your Symphony project’s front-end interface. This can be internal content (e.g. data pulled directly from your sections) or external content (e.g. data from an RSS feed or an XML API). Data sources are attached to pages, and the XML they provide can be transformed by page templates.

Parameters

Parameters are a powerful tool in data sources for dynamically designing pages and saving resources.

  • Required parameters
    A data source will only be executed if the specified required parameter is present.
    Example XML message:
    Data source not executed, required parameter is missing.
  • Forbidden parameters
    Conversely, the execution of a data source can be blocked if a forbidden parameter is detected.
    Example XML message:
    Data source not executed, forbidden parameter was found.

Parameters written to the param pool can also be used to trigger other data sources (see “Create a new data source”, step 8).

Filters

Filters can be used to significantly refine the output of entries from a section.

Typical standard filters could be:

  • “Online (checkbox)“ → yes
  • “Published on (date)“ → equal to or earlier than now

This ensures that only entries marked as “Online” and with a date equal to or earlier than the current time are retrieved. As a result, entries can be published or unpublished with just one click. It also makes it possible to prepare content in advance — something that isn’t possible when relying solely on the system date (see also “Create a Section”).

Other common filters could be:

  • “Title (Text Input)“ → {$title}
  • “System ID“ → {$id}

Create a new data source

To create a new data source, go to “Blueprints” → “Data Sources” → “Create New”.

Naming

Choose clear and descriptive names so that the purpose of the data source is immediately recognizable. This will help keep your project structured and maintainable, especially as it grows.

  1. Select the section from which entries are to be retrieved as the source.
  2. Enter a unique name for the data source.
  3. Under “Execution Conditions,” you can specify a “Required Parameter” and/or a “Forbidden Parameter”.
  4. Create filters using the fields in the section.
  5. Sort the entries (tip: use the field from the extension “Order Entries”).
  6. Grouping: Here you have the option to group the entries based on a field.
  7. Pagination: You can find out how to paginate entries in the examle “Pagination”.
  8. Content
    • Included Elements: Select the elements that you want to write to the XML.
    • Parameters: Select the elements that should be written to the param pool.
  9. Attach the data source to one or more pages.
  10. Create the data source by clicking the button “Create Data Source”.