Skip to content

Commit c0505e6

Browse files
authored
[TASK] Update Fluid theme section (#5387)
to take new PAGEVIEW into account Resolves: #3255 Releases: main, 13.4
1 parent f5087e5 commit c0505e6

File tree

9 files changed

+92
-120
lines changed

9 files changed

+92
-120
lines changed

Documentation/ApiOverview/Fluid/Introduction.rst

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -204,68 +204,72 @@ import can be done in the template or the partial.
204204

205205
.. _fluid-theme-example:
206206

207-
Example: Using Fluid to create a theme
208-
======================================
207+
Example: Using Fluid to create a theme for a site package
208+
=========================================================
209209

210-
This example was taken from the `example extension <https://github.com/TYPO3-Documentation/site_package/>`__
211-
for :ref:`t3sitepackage:start` and reduced to a very basic example.
210+
This example was taken from a theme created by the
211+
`Site Package Builder <https://get.typo3.org/sitepackage/new/>`_
212+
and reduced to a very basic example.
212213

213-
The site package tutorial walks you through the creation of a site package
214-
(theme) using Fluid. In our simplified example, the overall structure of
215-
a page is defined by a layout "Default". We show an example of a three
216-
column layout. Further templates can be added later, using the same layout.
214+
.. seealso::
215+
* If you want to try this out, you can `Generate a site package with the
216+
official builder <https://docs.typo3.org/permalink/t3sitepackage:site-package-builder>`_.
217+
* The `Site package tutorial <https://docs.typo3.org/permalink/t3sitepackage:start>`_
218+
describes the usage of the templates step by step.
217219

218220
.. directory-tree::
219221
:show-file-icons: true
220222

221-
* EXT:my_sitepackage/
223+
* packages/my_sitepackage/
222224

223-
* Configuration
225+
* Configuration/Sets/SitePackage/setup.typoscript
224226

225-
* Typoscript
227+
* Resources/Private/PageView
226228

227-
* setup.typoscript
229+
* Layouts
228230

229-
* Resources
230-
231-
* Private
231+
* PageLayout.html
232232

233-
* Layouts
233+
* Partials
234234

235-
* Page
235+
* Content.html
236+
* Footer.html
237+
* ...
236238

237-
* Default.html
239+
* Pages
238240

239-
* Partials
241+
* Default.html
242+
* Subpage.html
240243

241-
* Page
244+
Set the Fluid base path with TypoScript using the
245+
`PAGEVIEW <https://docs.typo3.org/permalink/t3tsref:cobj-pageview>`_ TypoScript
246+
object.
242247

243-
* Jumbotron.html
248+
.. literalinclude:: _Introduction/_pageview.typoscript
249+
:caption: packages/my_sitepackage/Configuration/Sets/SitePackage/setup.typoscript
244250

245-
* Templates
251+
The template in file :file:`Pages/Default.html` is automatically used whenever there is
252+
no specific template for the current `Backend layout <https://docs.typo3.org/permalink/t3coreapi:be-layout>`_ of the page.
246253

247-
* Page
254+
.. literalinclude:: _Introduction/_Default.html
255+
:caption: EXT:my_sitepackage/Resources/Private/PageView/Pages/Default.html
248256

249-
* ThreeColumn.html
257+
It includes the layout :file:`Layouts/PageLayout.html`. And uses partial
258+
:file:`Partials/Content.html` to display its content.
250259

251-
Set the Fluid paths with TypoScript using :ref:`t3tsref:cobj-fluidtemplate`
260+
It uses the partial :file:`Partials/Content.html` to display its content.
252261

253-
.. literalinclude:: _Introduction/_lib.dynamicContent.typoscript
254-
:caption: my_sitepackage/Configuration/TypoScript/setup.typoscript
262+
.. literalinclude:: _Introduction/_Content.html
263+
:caption: Resources/Private/PageView/Partials/Content.html
255264

256-
.. literalinclude:: _Introduction/_Default.html
257-
:caption: EXT:my_sitepackage/Resources/Private/Layouts/Page/Default.html
265+
The template for a different backend layout will look similar, but has for
266+
example two columns:
258267

259-
.. literalinclude:: _Introduction/_ThreeColumn.html
260-
:caption: my_sitepackage/Resources/Private/Templates/Page/ThreeColumn.html
268+
.. literalinclude:: _Introduction/_Subpage.html
269+
:caption: my_sitepackage/Resources/Private/PageView/Page/Subpage.html
261270

262-
* The template uses the layout "Default". It must then define all sections that the layout
263-
requires: "Header", "Main" and "Footer".
264-
* In the section "Main", a partial "Jumbotron" is used.
265-
* The template makes use of column positions (colPos). The content elements for each section
266-
on the page will be rendered into the correct `div`. Find out more about this in :ref:`be-layout`.
267-
* Again, we are using Object Accessors to access data (e.g. `{colPos: '2'}`) that has been
268-
generated elsewhere.
271+
The page layout takes care of elements that are shared across all or most page
272+
types:
269273

270-
.. literalinclude:: _Introduction/_Jumbotron.html
271-
:caption: Resources/Private/Partials/Page/Jumbotron.html
274+
.. literalinclude:: _Introduction/_PageLayout.html
275+
:caption: my_sitepackage/Resources/Private/PageView/Layouts/PageLayout.html
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<f:for each="{records}" as="record">
2+
<f:cObject
3+
typoscriptObjectPath="{record.mainType}"
4+
data="{record}"
5+
table="{record.mainType}"
6+
/>
7+
</f:for>
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
<f:render section="Header" />
2-
<f:render section="Main" />
3-
<f:render section="Footer" />
1+
<f:layout name="PageLayout"/>
2+
<f:section name="Main">
3+
<div class="container">
4+
<f:render partial="Content" arguments="{records: content.main.records}"/>
5+
</div>
6+
7+
</f:section>

Documentation/ApiOverview/Fluid/_Introduction/_Jumbotron.html

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<f:asset.css identifier="main" href="EXT:my_site_package/Resources/Public/Css/main.css" />
2+
<main>
3+
<f:render partial="Header" arguments="{_all}"/>
4+
<f:render section="Main"/>
5+
<f:render partial="Footer" arguments="{_all}"/>
6+
</main>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<f:layout name="PageLayout"/>
2+
<f:section name="Main">
3+
<div class="container">
4+
<div class="row">
5+
<div class="col-md-8">
6+
<f:render partial="Content" arguments="{records: content.main.records}"/>
7+
</div>
8+
<div class="col-md-4">
9+
<f:render partial="Content" arguments="{records: content.sidebar.records}"/>
10+
</div>
11+
</div>
12+
</div>
13+
</f:section>

Documentation/ApiOverview/Fluid/_Introduction/_ThreeColumn.html

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

Documentation/ApiOverview/Fluid/_Introduction/_lib.dynamicContent.typoscript

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
page = PAGE
2+
page {
3+
10 = PAGEVIEW
4+
10 {
5+
paths {
6+
0 = EXT:my_site_package/Resources/Private/PageView/
7+
10 = {$MySitePackage.template_path}
8+
}
9+
10+
dataProcessing {
11+
# makes content elements available as {content} in Fluid template
12+
10 = page-content
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)