Skip to content

Commit 9bc5730

Browse files
committed
Revert "[FEATURE] Create a minimal site package (#189)"
This reverts commit 6a737dd Resolves: #283
1 parent 7c11432 commit 9bc5730

File tree

4 files changed

+74
-138
lines changed

4 files changed

+74
-138
lines changed

Documentation/Index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ A working copy of the site package extension can be retrieved from the
4040
.. card-footer:: :ref:`See the prerequisites <t3sitepackage:prerequisites>`
4141
:button-style: btn btn-secondary stretched-link
4242

43-
.. card:: :ref:`Minimal site package <t3sitepackage:minimal-design>`
43+
.. card:: :ref:`Minimal example <t3sitepackage:minimal-design>`
4444

45-
Create a minimal site package that outputs "Hello World".
45+
We explain how you can easily show some text in the frontend. The
46+
example explains how to use TypoScript to output text in the
47+
frontend.
4648

47-
.. card-footer:: :ref:`Create a minimal site package <t3sitepackage:minimal-design>`
49+
.. card-footer:: :ref:`See the minimal example <t3sitepackage:minimal-design>`
4850
:button-style: btn btn-secondary stretched-link
4951

5052
.. card:: :ref:`Design Template <t3sitepackage:dt-external-resources>`

Documentation/MinimalExample/Index.rst

Lines changed: 69 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -3,148 +3,98 @@
33

44
.. _minimal-design:
55

6-
====================
7-
Minimal site package
8-
====================
6+
===============
7+
Minimal example
8+
===============
99

10-
A site package is a custom TYPO3 extension which contains configuration,
11-
templates, assets, etc that are used for the site it belongs to.
10+
We want to create a site package that outputs a single web page with
11+
minimal effort. This site package can be used to simply test system output or as
12+
an example of the fewest possible steps to create a working site package.
1213

13-
So first we create a minimal extension.
14-
15-
.. _minimal-extension:
16-
17-
Create a minimal TYPO3 extension using b13/make
18-
===============================================
19-
20-
:composer:`b13/make` is a convenient TYPO3 extension which you can use during
21-
development to create a new TYPO3 extension quickly or add functionality to an
22-
existing one.
23-
24-
Use Composer to install it for development only:
25-
26-
.. code-block:: bash
27-
28-
ddev composer req b13/make --dev
29-
30-
Execute the command `ddev typo3 make:extension` and answer the prompt
31-
32-
.. code-block:: bash
33-
34-
ddev typo3 make:extension
35-
36-
Enter the composer package name (e.g. "vendor/awesome"):
37-
> t3docs/site-package
38-
39-
Enter the extension key [site_package]:
40-
>
41-
42-
Enter the PSR-4 namespace [T3docs/SitePackage]:
43-
>
44-
45-
Choose supported TYPO3 versions (comma separate for multiple) [TYPO3 v12 LTS]:
46-
[10] TYPO3 v10 LTS
47-
[11] TYPO3 v11 LTS
48-
[12] TYPO3 v12 LTS
49-
[13] TYPO3 v13
50-
> 12
51-
52-
Enter a description of the extension:
53-
> My site package
54-
55-
Where should the extension be created? [src/extensions/]:
56-
> packages
57-
58-
May we add a basic service configuration for you? (yes/no) [yes]:
59-
> no
60-
61-
May we create a ext_emconf.php for you? (yes/no) [no]:
62-
>
63-
64-
[OK] Successfully created the extension my_site_package (myvendor/my-site-package).
65-
66-
This script creates a new folder called `packages` with a subfolder,
67-
`my-site-package`. It mainly contains only a file called `composer.json`.
68-
69-
You could of course also create this file manually. Step
70-
:ref:`extension-configuration` will explain the content of the :file:`composer.json`.
71-
For the time being just remember the Composer name you have chosen
72-
(`t3docs/site-package`) and the extension name (`site_package`).
73-
74-
In order to see a change in the TYPO3 backend or frontend your site package needs
75-
to be :ref:`installed <extension-installation>`.
76-
77-
After you have created your site package extension you can uninstall :composer:`b13/make`:
78-
79-
.. code-block:: bash
80-
81-
ddev composer remove b13/make --dev
82-
83-
.. _minimal-extension-typoscript:
14+
To start, in the TYPO3 backend, create a standard page named
15+
:guilabel:`Minimal example` just under (inside) the page tree TYPO3 logo
16+
container. Create a new TypoScript template record on this page.
17+
Give the TypoScript template a title, and make it a root level template,
18+
but do not include any static templates.
8419

8520
The TypoScript-only version
8621
===========================
8722

88-
Create a file called :file:`setup.typoscript` containing basic TypoScript configuration
89-
in the folder :path:`Configuration/Setup`:
23+
In the TypoScript template Setup field, add the following three lines:
9024

91-
.. literalinclude:: _minimal.typoscript
92-
:caption: packages/site-package/Configuration/TypoScript/Setup/setup.typoscript
25+
.. code-block:: typoscript
26+
:caption: TypoScript Setup
9327
94-
Clear all caches and preview the web page.
28+
page = PAGE
29+
page.1 = TEXT
30+
page.1.value = Hello, world.
9531
96-
You can learn more about the TypoScript syntax used here in chapter
97-
:ref:`A minimal page created by pure TypoScript <t3start:typoscript>`
98-
of the "Getting Started Tutorial".
32+
View the web page.
9933

100-
.. _minimal-extension-fluid:
34+
This TypoScript-only design has the least instructions required to output a
35+
web page from TYPO3. This TypoScript template is self contained and
36+
no other files or database records needed. Changing this content
37+
only requires the appropriate access needed to make changes to TypoScript
38+
templates.
10139

10240
The TYPO3 Fluid version
10341
=======================
10442

105-
Replace file :file:`setup.typoscript` of example
106-
:file:`minimal-extension-typoscript` with the following lines:
43+
Empty the :guilabel:`Minimal design` page TypoScript template Setup field,
44+
then add the following lines:
10745

108-
.. literalinclude:: _pageview.typoscript
109-
:caption: ackages/site-package/Configuration/TypoScript/Setup/setup.typoscript
110-
:linenos:
46+
.. code-block:: typoscript
47+
:caption: TypoScript Setup
11148
112-
If you preview your page now you would get an error output like:
49+
page = PAGE
50+
page.1 = FLUIDTEMPLATE
51+
page.1.file = EXT:site_package/Resources/Private/Templates/Minimal.html
11352
114-
.. code-block:: html
53+
Create a file named :file:`Minimal.html` in a
54+
:file:`typo3conf/ext/site_package/Resources/Private/Templates` folder.
11555

116-
Oops, an error occurred! Request: bddd8a816bda3
56+
The site package extension has to be :ref:`installed <extension-installation>`
57+
and requires a :ref:`minimal composer configuration <extension-configuration>` (if composer is used)
58+
for this to work
11759

118-
.. todo: Add information about dealing with errors such as these and link from here.
119-
120-
This is because the template has not been found.
60+
.. code-block:: html
61+
:caption: EXT:site_package/Resources/Private/Templates/Minimal.html
12162

122-
By searching for the hash `bddd8a816bda3` in the log file you will find such an entry:
63+
Hello, world.
12364

124-
.. code-block:: plaintext
125-
:caption: var/log/typo3_ece44d5005.log
126-
:emphasize-lines: 7
65+
Now view the web page.
12766

128-
Mon, 07 Oct 2024 04:09:44 +0000 [ALERT] request="bddd8a816bda3"
129-
component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler":
130-
Oops, an error occurred! Request: bddd8a816bda3- InvalidTemplateResourceException:
131-
Tried resolving a template file for controller action "Default->Pages/Default"
132-
in format ".html", but none of the paths contained the expected template file
133-
(Default/Pages/Default.html).
134-
The following paths were checked: /var/www/html/vendor/t3docs/site-package/Resources/Private/Templates/
67+
Here we are putting the page content into a separate HTML file, allowing for
68+
separate access control and for an editing workflow that does not need much
69+
TypoScript. The TYPO3 renderer still requires a TypoScript template on the
70+
:guilabel:`Minimal design` page to know which file to process.
13571

136-
This error message also tells you the path where TYPO3 expects to find the file. If no path
137-
is listed here, the path defined in line 6 of the TypoScript above is incorrect,
138-
for example if you mistyped the extension name or part of the path.
72+
Resulting web page
73+
==================
13974

140-
Create a file named :file:`Default.html` in folder
141-
:path:`packages/site-package/Resources/Private/Pages`.
75+
Here is the resulting web page HTML source for both the TypoScript-only and
76+
the Fluid based implementations. Notice how TYPO3 has added default markup
77+
around the single line of content:
14278

14379
.. code-block:: html
144-
:caption: packages/site-package/Resources/Private/Pages/Default.html
145-
146-
Hello Fluid World!
147-
148-
Clear all caches and preview the web page.
149-
150-
Learn more about using Fluid Templates in chapter :ref:`fluid-templates`.
80+
:caption: Example frontend output
81+
82+
<!DOCTYPE html>
83+
<html lang="en">
84+
<head>
85+
<meta charset="utf-8">
86+
<!--
87+
This website is powered by TYPO3 - inspiring people to share!
88+
TYPO3 is a free open source Content Management Framework initially
89+
created by Kasper Skaarhoj and licensed under GNU/GPL.
90+
TYPO3 is copyright 1998-2018 of Kasper Skaarhoj. Extensions are
91+
copyright of their respective owners.
92+
Information and contribution at https://typo3.org/
93+
-->
94+
<title>Minimal design</title>
95+
<meta name="generator" content="TYPO3 CMS">
96+
</head>
97+
<body>
98+
Hello, world.
99+
</body>
100+
</html>

Documentation/MinimalExample/_minimal.typoscript

Lines changed: 0 additions & 7 deletions
This file was deleted.

Documentation/MinimalExample/_pageview.typoscript

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)