Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] #103894 - Additional properties for columns in Page Layouts #534

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Documentation/PageTsconfig/Mod/WebLayout/BackendLayout.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,32 @@ package (GitHub) <https://github.com/benjaminkott/bootstrap_package/tree/master/

When content elements are added to this area, the value of `colPos`

.. confval:: identifier
:name: mod-web-layout-BackendLayouts-backendLayout-title-config-backend_layout-rows-row-columns-col-identifier
:type: string

An identifier that can will be used by the page content
linawolf marked this conversation as resolved.
Show resolved Hide resolved
linawolf marked this conversation as resolved.
Show resolved Hide resolved
DataProcessor to identify the content elements within this
area.

It is a speaking representation for the :confval:`colPos <mod-web-layout-BackendLayouts-backendLayout-title-config-backend_layout-rows-row-columns-col-colPos>`,
such as "main", "sidebar" or "footerArea".

.. confval:: slideMode
:name: mod-web-layout-BackendLayouts-backendLayout-title-config-backend_layout-rows-row-columns-col-slideMode
:type: string, "" (empty string), "slide", "collect", "collectReverse"

An identifier that can will be used by the page content
linawolf marked this conversation as resolved.
Show resolved Hide resolved
linawolf marked this conversation as resolved.
Show resolved Hide resolved
DataProcessor to identify the content elements within this
area.

`slide`
If no content is found, check the parent pages for more content
`collect`
Use all content from this page, and the parent pages as one collection
`collectReverse`
Same as "collect" but in the opposite order

.. confval:: colspan
:name: mod-web-layout-BackendLayouts-backendLayout-title-config-backend_layout-rows-row-columns-col-colspan
:type: integer, 1 - :confval:`mod-web-layout-BackendLayouts-backendLayout-title-config-backend_layout.colCount`
Expand All @@ -97,3 +123,25 @@ package (GitHub) <https://github.com/benjaminkott/bootstrap_package/tree/master/

Can be used if the content element area should span multiple
rows.

Example: Use a backend layout in the page content data processor
================================================================

Define the backend layout via page TSconfig, for example in the site:

.. literalinclude:: _BackendLayout.tsconfig
:caption: config/sites/my-site/page.tsconfig

Configure the output via TypoScript, using the content object
:ref:`PAGEVIEW <t3tsref:cobj-pageview>` and the DataProcessor
`page-content`.

.. todo: Link Dataprocessor

.. literalinclude:: _BackendLayout.typoscript
:caption: config/sites/my-site/setup.typoscript

Use the identifiers of the columns in the Fluid template:

.. literalinclude:: _Default.html
:caption: EXT:my_sitepackage/Resources/Private/Templates/Pages/Default.html
41 changes: 41 additions & 0 deletions Documentation/PageTsconfig/Mod/WebLayout/_BackendLayout.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
mod.web_layout.BackendLayouts {
default {
title = Default
config {
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Jumbotron
colPos = 1
identifier = jumbotron
slideMode = slide
colspan = 2
}
}
}

1 {
columns {
1 {
name = Left
colPos = 0
identifier = left
}

2 {
name = Right
colPos = 2
identifier = right
slideMode = collectReverse
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
page = PAGE
page {
10 = PAGEVIEW
10 {
paths.10 = EXT:my_sitepackage/Resources/Private/Templates/
dataProcessing.10 = page-content
dataProcessing.10.as = myContent
}
}
12 changes: 12 additions & 0 deletions Documentation/PageTsconfig/Mod/WebLayout/_Default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<f:render partial="Jumbotron" arguments="{jumbotronContent: myContent.jumbotron}"/>
<main>
<f:for each="{myContent.left.records}" as="contentElement">
<f:cObject typoscriptObjectPath="tt_content.{contentElement.data.CType}"
data="{contentElement.data}"
table="tt_content"
/>
</f:for>
</main>
<aside>
<f:render partial="Aside" arguments="{content: myContent.right}"/>
</aside>