Skip to content

Commit

Permalink
[TASK] Split up Configuration section (#197)
Browse files Browse the repository at this point in the history
* [TASK] Split up Configuration section

- Fluid-styled-content dependencies are moved to content mapping
- TypoScript imports from site set are kept in a dedicated file
- Site settings etc are also moved to a dedicated file
- Reorder menu so that steps properly depend on each other

Releases: main

* Update Documentation/SiteSets/Index.rst

Co-authored-by: mkiebele <[email protected]>

---------

Co-authored-by: mkiebele <[email protected]>
  • Loading branch information
linawolf and mkiebele authored Oct 14, 2024
1 parent 543bea3 commit 3b67b5c
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 235 deletions.
17 changes: 17 additions & 0 deletions Documentation/ContentMapping/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ The output of content into the front end is defined via TypoScript.

See :ref:`Backend layouts <t3coreapi:be-layout>` for more information about setting up various columns and rows.

.. _content-mapping-site-set:

Include the site sets of fluid-styled-content as dependency
===========================================================

In step :ref:`Minimal site package - Create a basic site
set <t3sitepackage:minimal-extension-siteset>` we created a basic site set for
our site package.

Add a dependency to the sets provided by the system extension
:composer:`typo3/cms-fluid-styled-content`. This step is a prerequisite to
display the content in the next steps.

Your site set configuration should now look like this:

.. include:: /CodeSnippets/ExtensionConfiguration/SitePackage-config.rst.txt


Define the backend layouts
==========================
Expand Down
16 changes: 12 additions & 4 deletions Documentation/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ A working copy of the site package extension can be retrieved from the
.. card-footer:: :ref:`Learn about Fluid and Templating <t3sitepackage:fluid-templates>`
:button-style: btn btn-secondary stretched-link

.. card:: :ref:`TypoScript setup <t3sitepackage:typoscript-configuration>`

Theoretically you could put all TypoScript into one big file and it would work
fine. But you have better overview if you split it up in multiple files ordered
by purpose. We import all TypoScript files from a folder using wildcards
after this step.

.. card-footer:: :ref:`Automatically import TypoScript files <t3sitepackage:typoscript-configuration>`
:button-style: btn btn-secondary stretched-link

.. card:: :ref:`Content mapping <t3sitepackage:content-mapping>`

Here we explain the purpose of backend layouts. Additionally we
Expand All @@ -86,7 +96,6 @@ A working copy of the site package extension can be retrieved from the
.. card-footer:: :ref:`See how to use a backend layout <t3sitepackage:content-mapping>`
:button-style: btn btn-secondary stretched-link


.. card:: :ref:`Main menu <t3sitepackage:main-menu-creation>`

We introduce the main menu, explain how we build up a menu
Expand Down Expand Up @@ -130,8 +139,6 @@ A working copy of the site package extension can be retrieved from the
.. card-footer:: :ref:`See the summary <t3sitepackage:summary>`
:button-style: btn btn-secondary stretched-link



.. toctree::
:maxdepth: 2
:titlesonly:
Expand All @@ -143,9 +150,10 @@ A working copy of the site package extension can be retrieved from the
MinimalExample/Index
Assets/Index
FluidTemplates/Index
TypoScript/Index
ContentMapping/Index
MainMenuCreation/Index
TypoScriptConfiguration/Index
SiteSets/Index
ExtensionConfiguration/Index
ExtensionInstallation/Index
Summary/Index
Expand Down
34 changes: 34 additions & 0 deletions Documentation/SiteSets/Index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:navigation-title: Site sets
.. include:: /Includes.rst.txt

.. _site-sets-configuration:

========================================
Site sets: Further configuration options
========================================

.. versionadded:: 13.1
Site sets have been introduced with TYPO3 13.1.

In step :ref:`Minimal site package - Create a basic site
set <t3sitepackage:minimal-extension-siteset>` we created a basic site set for
our site package.

In step :ref:`content-mapping-site-set` we added dependencies to our site set.

.. _settings-definitions-yaml-constants:

Setting definition
------------------

Settings definitions are used to set values that can be used in the TypoScript
setup through out the project. Before they were kept in the file
:file:`constants.typoscript`. Since TYPO3 v13 they can be stored in the file
:file:`settings.definitions.yaml`. See
`settings.definitions.yaml <https://github.com/TYPO3-Documentation/TYPO3CMS-Tutorial-SitePackage-Code/blob/main/Configuration/Sets/SitePackage/settings.definitions.yaml>`__ in Github.

It is best practise to use them for values that might
want to be changed later on like paths, ids of important pages (contact,
imprint, a system folder that contains certain records, ...).

.. todo: Add more content here
86 changes: 86 additions & 0 deletions Documentation/TypoScript/Index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
.. include:: /Includes.rst.txt

.. _file-setup-typoscript:
.. _typoscript-configuration:

================
TypoScript setup
================

In step :ref:`Minimal site package - The TYPO3 Fluid
version <t3sitepackage:minimal-extension-fluid>` we placed all TypoScript into
the site set, file
:file:`packages/site-package/Configuration/Sets/SitePackage/setup.typoscript`.

In the following chapters we will need additional TypoScript setup
configurations.

Theoretically you could put all TypoScript into one big file and it would work
fine. But you have better overview if you split it up in multiple files ordered
by purpose.

Familiarize yourself with the TypoScript `@import` syntax first:
:ref:`TYPO3 Explained, @import syntax <t3coreapi:typoscript-syntax-includes>`.

.. _typoscript-import:

Import the TypoScript from a different location
===============================================

Create a new folder called :path:`Configuration/TypoScript/Setup`. In this
create a file called :file:`pageview.typoscript` and copy the content from
file :file:`Configuration/Sets/SitePackage/setup.typoscript`
into it.

Then change the latter file to contain the following:

.. code-block:: typoscript
:caption: Configuration/Sets/SitePackage/setup.typoscript
@import 'EXT:site_package/Configuration/TypoScript/Setup/pageview.typoscript'
Flush the caches and preview the page. The output should be unchanged.

.. _typoscript-import-wildcard:

Import all TypoScript files from a folder using a wildcard
==========================================================

We will create more TypoScript files in the next steps. We could import them
file by file. But as the order will not matter we can import all of them via
wildcard:

.. include:: /CodeSnippets/TypoScript/Setup.rst.txt

Only files from the folder directly will be imported. If you create subfolders
later on you have to import them separately.

.. _typoscript-import-configuration:

Structure of the `Configuration` directory
==========================================

Your :path:`Configuration` directory should now have the following structure:

.. directory-tree::
:level: 4
:show-file-icons: true

* EXT:my_sitepackage/Configuration

* Sets

* SitePackage

* config.yaml
* setup.typoscript

* TypoScript

* Setup

* pageview.typoscript

In the next steps you will create more TypoScript files to configure the
:ref:`Content mapping <t3sitepackage:content-mapping>` and the
:ref:`menus <t3sitepackage:main-menu-creation>`.
Loading

0 comments on commit 3b67b5c

Please sign in to comment.