.. include:: /Includes.rst.txt .. _feature-seeded-showcase-tree: =========================================== Feature: A seeded showcase of every element =========================================== Description =========== :ref:`feature-seeding` writes a page tree from a YAML definition. The shipped definition :file:`EXT:theme_extension_development/Configuration/Seeds/Demo.yaml` now describes a tree that demonstrates the whole theme rather than a handful of pages: .. list-table:: :header-rows: 1 * - Page - Backend layout - What it shows * - :guilabel:`Theme demo` (``/``) - :guilabel:`Start page` - The site root, and the footer columns that layout adds. * - :guilabel:`Typography` (``/typography``) - :guilabel:`Content page` - Headings, running text and the inline cases a stylesheet has to answer for. * - :guilabel:`Media` (``/media``) - :guilabel:`Content page` - A single image, and a two column gallery. * - :guilabel:`Empty page` (``/empty``) - *none* - A page with no layout selected, which falls back to the default. * - :guilabel:`Elements` (``/elements``) - :guilabel:`Content page` - The showcase branch, and the parent of the three pages below. * - :guilabel:`Core elements` (``/elements/core``) - :guilabel:`Content page with sidebar` - Every classic content element the theme renders, once each. * - :guilabel:`Menu elements` (``/elements/menu``) - :guilabel:`Content page with sidebar` - All eleven menu elements, each pointed at a different part of the tree so they are told apart by what they list. * - :guilabel:`Theme elements` (``/elements/theme``) - :guilabel:`Content page` - All ten elements the extension registers itself, with their inline children filled in. * - :guilabel:`Styleguide` (``/styleguide``) - :guilabel:`Styleguide` - The component library, rendered from Fluid rather than from content. Between them the pages use every backend layout the extension registers and carry every content type it renders, so a single seeded instance answers what the theme does with each. Two of the pages are deliberate special cases: :guilabel:`Empty page` selects no backend layout at all, which is the only way to see the default fallback, and :guilabel:`Styleguide` is set to :guilabel:`Page not enabled in menus` rather than disabled - a disabled page returns 404 in the frontend and is only reachable through a preview link, which defeats the point of seeding a page that exists to be opened. Inline children in the seed format ================================== Four of the theme's own content elements - :guilabel:`Author`, :guilabel:`Link list`, :guilabel:`Social links` and :guilabel:`Media teaser grid` - read their entries from an inline child table. A seed definition can now describe those entries with a new structural key, ``inline``: a map of the field on the parent record to the child records declared for it. .. code-block:: yaml content: - identifier: showcase-linklist CType: theme_linklist header: 'Where to read more' inline: tx_theme_list_items: - identifier: showcase-docs table: tx_theme_list_item link: 't3://page?uid=2' link_label: 'Typography' - identifier: showcase-media table: tx_theme_list_item link: 't3://page?uid=3' link_label: 'Media' Each child names the ``table`` it belongs to. That is never inferred from the TCA of the parent's field, so a definition stays readable on its own and a mistyped field name is reported rather than dereferenced. The children come out in the order they are declared, and they may carry ``uid`` and ``files`` like any other record. The structural keys of the format are therefore ``identifier``, ``uid``, ``children``, ``content``, ``files`` and ``inline``, plus ``table`` on an inline child. Everything else is a field of the record and is written as it stands - which is why the backend layout and the "hide in menus" flag of the pages above need nothing from the seeding at all. Identifiers may no longer contain an underscore =============================================== An ``identifier`` in a seed definition may contain letters, digits and dashes, and has to start with a letter or a digit. A definition using anything else is now rejected with an exception naming the identifier. This is not a style rule. The identifier ends up inside the placeholder DataHandler is given for the record, and a placeholder used as the value of a relation field is read as the ``