.. _breaking-site-sets-and-static-templates-restructured: =============================================================== Breaking: Site sets and static templates have been restructured =============================================================== Description =========== The TypoScript and the page TSconfig of this extension were shipped twice: the static template read :file:`Configuration/TypoScript/`, and the site set :yaml:`fgtclb/academic-bite-jobs` shipped its own :file:`constants.typoscript` and :file:`setup.typoscript`, each of them a single :typoscript:`@import` of that folder. The page TSconfig existed only as the wizard file :file:`Configuration/TsConfig/Wizards/NewContentElement.tsconfig` and was not selectable on a page at all. Both mechanisms now read one physical copy of every file, and both of them deliver the extension per component instead of as one block: * :file:`Configuration/TypoScript/List/` holds the TypoScript of the :guilabel:`Bite Jobs List` content element and is what the static template registers *and* what the set points its :yaml:`typoscript` key at. * :file:`Configuration/TSconfig/List/page.tsconfig` holds its page TSconfig and is what the page field :guilabel:`Page TSconfig` offers *and* what the set points its :yaml:`pagets` key at. * :file:`Configuration/TypoScript/Full/` and :file:`Configuration/TSconfig/Full/page.tsconfig` are the aggregates for installations that do not use site sets. On TYPO3 v12 that is every installation, because site sets arrived in TYPO3 v13.1. Note the directory as well: :file:`Configuration/TsConfig/` was renamed to :file:`Configuration/TSconfig/`, the spelling TYPO3 itself uses, so that all academic extensions agree on one. The content element is now **hidden by default**. The always-included :file:`Configuration/page.tsconfig` removes :typoscript:`academicbitejobs_list` from the selectable content element types, and the page TSconfig of the component adds it back. The element is therefore offered where it is wanted instead of on every page of every installation. The TCA registration itself did not move, so the frontend renders existing records exactly as before. Editing such a record in the backend needs care. Read the warning below before upgrading. Impact ====== A :sql:`sys_template` record that selected the old static template keeps its stored value. The folder of that value holds no TypoScript of its own any more. It imports the files of the component folder instead, so it delivers what :guilabel:`All components` delivers. The path is deprecated and will be removed in version 4.0, see :ref:`deprecation-legacy-static-template-path`. A site package that imported :file:`Configuration/TypoScript/setup.typoscript` or :file:`Configuration/TypoScript/constants.typoscript` by path keeps getting the configuration, deprecated in the same way. Every other shipped file it imported by path fails to resolve. :typoscript:`@import` of a missing file is silent, so this shows up as missing configuration rather than as an error message. The :guilabel:`Bite Jobs List` content element is no longer offered in the backend until the page TSconfig of the component is included, through the site set or through the page field :guilabel:`Page TSconfig`. On TYPO3 v12 the page field is the only one of the two that works, and that same file also carries the entry of the new content element wizard, which v12 builds from page TSconfig rather than from TCA. .. warning:: Do not open an existing :guilabel:`Bite Jobs List` record in the backend form on a page that does not include that page TSconfig. An item removed through :typoscript:`TCEFORM.tt_content.CType.removeItems` is excluded from the :guilabel:`[ invalid value ]` fallback TYPO3 otherwise adds for a stored value it does not know, and the stored value is dropped from the form data as well. The field :guilabel:`Type` therefore comes up with nothing selected, and **saving the record writes whatever the browser preselected into** :sql:`CType`. The record silently becomes another content element. The frontend keeps rendering it correctly until that happens. Include the page TSconfig of the component on every page tree that holds such records, and do it before editing them. The set :yaml:`fgtclb/academic-bite-jobs` keeps its name and keeps delivering everything, so a site configuration that depends on it needs no change. Affected Installations ====================== Installations that select the static template of this extension in a :sql:`sys_template` record, that import one of the shipped files from an own site package, or that use the content element without including the page TSconfig of this extension. Migration ========= Replace the deprecated static template entry in the :sql:`sys_template` record: .. list-table:: :header-rows: 1 * - Old entry - New entry * - :guilabel:`Academic Bite Jobs (academic_bite_jobs)`, stored as `EXT:academic_bite_jobs/Configuration/TypoScript` - :guilabel:`Academic Bite Jobs: All components (academic_bite_jobs)`, stored as `EXT:academic_bite_jobs/Configuration/TypoScript/Full`, or :guilabel:`Academic Bite Jobs: Job list (academic_bite_jobs)`, stored as `EXT:academic_bite_jobs/Configuration/TypoScript/List` Add the page TSconfig entry, which did not exist before, in the page record of the site root, tab :guilabel:`Resources`, field :guilabel:`Page TSconfig`: :guilabel:`Academic Bite Jobs: All components (academic_bite_jobs)`, stored as `EXT:academic_bite_jobs/Configuration/TSconfig/Full/page.tsconfig`. Without it the content element is not selectable any more, and existing records of it lose their :sql:`CType` when they are saved from the backend form. Sites that use the site set instead need no migration. They must not use both mechanisms at once, see the :guilabel:`Configuration` chapter. That applies to TYPO3 v13 only. On TYPO3 v12 the entries above are required. Adjust every :typoscript:`@import` in an own site package: .. list-table:: :header-rows: 1 * - Old path - New path * - `EXT:academic_bite_jobs/Configuration/TypoScript/constants.typoscript` - `EXT:academic_bite_jobs/Configuration/TypoScript/List/constants.typoscript` * - `EXT:academic_bite_jobs/Configuration/TypoScript/setup.typoscript` - `EXT:academic_bite_jobs/Configuration/TypoScript/List/setup.typoscript` * - `EXT:academic_bite_jobs/Configuration/TsConfig/Wizards/NewContentElement.tsconfig` - `EXT:academic_bite_jobs/Configuration/TSconfig/List/page.tsconfig` * - `EXT:academic_bite_jobs/Configuration/TsConfig/Wizards/*.tsconfig` - `EXT:academic_bite_jobs/Configuration/TSconfig/Full/page.tsconfig` A site configuration on TYPO3 v13 may name the new component set instead of the aggregate: .. list-table:: :header-rows: 1 * - Set - Delivers * - `fgtclb/academic-bite-jobs` - Unchanged in name, now delivers through the component set below. * - `fgtclb/academic-bite-jobs-list` - The :guilabel:`Bite Jobs List` content element only. .. index:: TypoScript, TSConfig, Backend, ext:academic_bite_jobs