Skip to content

Commit

Permalink
[FEATURE] Introduce Site Sets
Browse files Browse the repository at this point in the history
As a site set can only be used in TYPO3 v13
we can use the new constant syntax
{$plugin.tx_ttaddress.view.templateRootPath ?? $tt_address.templateRootPath} here.
The TypoScript will not be included by v12 installations.

resolves #570
  • Loading branch information
linawolf committed Aug 28, 2024
1 parent 07e0780 commit b5fcd8a
Show file tree
Hide file tree
Showing 13 changed files with 113 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 3
indent_size = 4
max_line_length = 80

# MD-Files
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/.styleci.yml export-ignore
/.travis.yml export-ignore
/.php_cs export-ignore
/Makefile export-ignore
2 changes: 2 additions & 0 deletions Configuration/Sets/Address/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: friendsoftypo3/tt-address
label: Addresses (Extbase/Fluid)
16 changes: 16 additions & 0 deletions Configuration/Sets/Address/settings.definitions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
settings:
tt_address.templateRootPath:
label: 'Path to template root (FE)'
description: ''
type: string
default: 'EXT:tt_address/Resources/Private/Templates/'
tt_address.partialRootPath:
label: 'Path to template partials (FE)'
description: ''
type: string
default: 'EXT:tt_address/Resources/Private/Partials/'
tt_address.layoutRootPath:
label: 'Path to template layouts (FE)'
description: ''
type: string
default: 'EXT:tt_address/Resources/Private/Layouts/'
14 changes: 14 additions & 0 deletions Configuration/Sets/Address/setup.typoscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import 'EXT:tt_addressConfiguration/TypoScript/setup.typoscript'
plugin.tx_ttaddress {
view {
templateRootPaths {
1 = {$plugin.tx_ttaddress.view.templateRootPath ?? $tt_address.templateRootPath}
}
partialRootPaths {
1 = {$plugin.tx_ttaddress.view.partialRootPath ?? $tt_address.partialRootPath}
}
layoutRootPaths {
1 = {$plugin.tx_ttaddress.view.layoutRootPath ?? $tt_address.layoutRootPath}
}
}
}
3 changes: 2 additions & 1 deletion Documentation/Configuration/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ where you do all the configuration for this extension. That extension template c
in the root template. In the extension template add the static TS configuration, otherwise it wont
work!

.. toctree::
.. toctree::
:maxdepth: 2
:titlesonly:

Sets/Index
ExtensionSettings/Index
TypoScript/Index
TsConfig/Index
Expand Down
50 changes: 50 additions & 0 deletions Documentation/Configuration/Sets/Index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
:navigation-title: Site sets
.. include:: /Includes.rst.txt

.. _configuration-extension-sets:

====================================
Site sets provided by EXT:tt_address
====================================

.. versionchanged:: tt_address 9.1.0 / TYPO3 v13.3
Site sets were added.

The extension :composer:`friendsoftypo3/tt-address` offers a site set
called "Addresses (Extbase/Fluid)" and has the key `friendsoftypo3/tt-address`.

.. _configuration-extension-sets-usage:

Using the site set "Addresses (Extbase/Fluid)"
==============================================

You can include this :ref:`Site set <t3coreapi:site-sets>` in your site configuration:

* Got to :guilabel:`Site Management > Sites`.
* Edit your site configuration.
* In :guilabel:`General > Sets for this Site` add the site set called
"Addresses (Extbase/Fluid)".

This changes the YAML file representing your site configuration as follows:

.. literalinclude:: _siteconfig.diff
:caption: config/sites/my_site/config.yaml (diff)

If you are using a :ref:`custom site package extension <t3sitepackage:start>`
providing a custom Set you can include `friendsoftypo3/tt-address` into your
site packages set:

.. literalinclude:: _setconfig.yaml
:caption: EXT:my_sitepackage/Configuration/Sets/MySitepackage/config.yaml

.. _configuration-extension-sets-settings:

Settings for site set "Addresses (Extbase/Fluid)"
=================================================

The following settings are available:

.. typo3:site-set-settings:: PROJECT:/Configuration/Sets/Address/settings.definitions.yaml
:name: address-settings
:type:
:Label: Settings of the site set of EXT:tt_address
5 changes: 5 additions & 0 deletions Documentation/Configuration/Sets/_setconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: myvendor/my-sitepackage
label: My Sitepackage
dependencies:
- my-vendor/my-other-set
- friendsoftypo3/tt-address
6 changes: 6 additions & 0 deletions Documentation/Configuration/Sets/_siteconfig.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
base: 'https://example.org/'
dependencies:
- typo3/fluid-styled-content-css
+ - friendsoftypo3/tt-address
languages:
-
Binary file added Documentation/Images/site_sets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Documentation/Tutorials/Templates/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

Working with the templates
==========================

.. versionchanged:: tt_address 9.1.0 / TYPO3 v13.3
You can use the :ref:`site set <configuration-extension-sets>` to configure
the template paths.

The following tutorials describe how to work best with the provided templates

Modify the templates
Expand Down
2 changes: 1 addition & 1 deletion Documentation/guides.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project-issues="https://github.com/FriendsOfTYPO3/tt_address/issues"
edit-on-github-branch="master"
edit-on-github="https://github.com/FriendsOfTYPO3/tt_address"
typo3-core-preferred="stable"
typo3-core-preferred="main"
interlink-shortcode="friendsoftypo3/tt-address"
/>
<project title="Address List"
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: help
help: ## Displays this list of targets with descriptions
@echo "The following commands are available:\n"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: docs
docs: ## Generate projects docs (from "Documentation" directory)
mkdir -p Documentation-GENERATED-temp

docker run --rm --pull always -v "$(shell pwd)":/project -t ghcr.io/typo3-documentation/render-guides:latest --config=Documentation

0 comments on commit b5fcd8a

Please sign in to comment.