Feature: #103504 - New ContentObject PAGEVIEW

See forge#103504

Description

A new content object for TypoScript PAGEVIEW has been added.

This cObject is mainly intended for rendering a full page in the TYPO3 frontend with fewer configuration options over the generic FLUIDTEMPLATE cObject.

A basic usage of the PAGEVIEW cObject is as follows:

page = PAGE
page.10 = PAGEVIEW
page.10.paths.100 = EXT:mysite/Resources/Private/Templates/
Copied!

PAGEVIEW wires certain parts automatically:

  1. The name of the used page layout (backend layout) is resolved automatically.

    If a page has a layout named "with_sidebar", the template file is then resolved to EXT:mysite/Resources/Private/Templates/Pages/With_sidebar.html.

  2. Fluid features for layouts and partials are wired automatically, thus they can be placed into EXT:mysite/Resources/Private/Templates/Layouts/ and EXT:mysite/Resources/Private/Templates/Partials/.

    In order to reduce the burden for integrators, the folder names for "pages", "layouts" and "partials" can start with a lowercase or an uppercase letter.

  3. Default variables are available in the Fluid template:

    • settings - contains all TypoScript settings (= constants)
    • site - the current Site object
    • language - the current SiteLanguage object
    • page - the current page record as object

There is no special Extbase resolving done for the templates.

Migration

Before

page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        templateName = TEXT
        templateName {
            stdWrap {
                cObject = TEXT
                cObject {
                    data = levelfield:-2, backend_layout_next_level, slide
                    override {
                        field = backend_layout
                    }
                    split {
                        token = pagets__
                        1 {
                            current = 1
                            wrap = |
                        }
                    }
                }
                ifEmpty = Standard
            }
        }

        templateRootPaths {
            100 = {$plugin.tx_mysite.paths.templates}
        }

        partialRootPaths {
            100 = {$plugin.tx_mysite.paths.partials}
        }

        layoutRootPaths {
            100 = {$plugin.tx_mysite.paths.layouts}
        }

        variables {
            pageUid = TEXT
            pageUid.data = page:uid

            pageTitle = TEXT
            pageTitle.data = page:title

            pageSubtitle = TEXT
            pageSubtitle.data = page:subtitle

            parentPageTitle = TEXT
            parentPageTitle.data = levelfield:-1:title
        }

        dataProcessing {
            10 = menu
            10.as = mainMenu
        }
    }
}
Copied!

After

page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths {
            100 = {$plugin.tx_mysite.paths.templates}
        }
        variables {
            parentPageTitle = TEXT
            parentPageTitle.data = levelfield:-1:title
        }
        dataProcessing {
            10 = menu
            10.as = mainMenu
        }
    }
}
Copied!

In Fluid, the pageUid is available as {page.uid} and pageTitle as {page.title}. The page layout identifier can be accessed using {page.pageLayout.identifier}.

Impact

Creating new page templates based on Fluid follows conventions in order to reduce the amount of TypoScript needed to render a page in the TYPO3 frontend.

Sane defaults are applied, variables and settings are available at any time.