PAGEVIEW vs. FLUIDTEMPLATE: A Streamlined Approach in TYPO3 v13

PAGEVIEW vs. FLUIDTEMPLATE: A Streamlined Approach in TYPO3 v13

In TYPO3 v13, the Core Team has introduced a brand-new ContentObject called PAGEVIEW. This feature is designed to make page rendering more straightforward than ever, especially for TYPO3 integrators who want a fast and efficient way to display content without diving into extensive template configuration. Let’s explore what PAGEVIEW brings to the table, how it compares to the existing FLUIDTEMPLATE cObject, and why it can be a game-changer for many TYPO3 projects.

PAGEVIEW is a simplified ContentObject that focuses on rendering a full TYPO3 frontend page with minimal overhead. It helps reduce the typically long Typoscript configurations required by the FLUIDTEMPLATE approach. If your site doesn’t need complex layout logic, PAGEVIEW can do the heavy lifting with fewer lines of configuration.

Key benefits of PAGEVIEW include:

  • Fewer lines of Typoscript needed for page rendering.
  • Rapid setup for projects with basic or standardized templating needs.
  • Straightforward syntax that is easy to adopt if you’re familiar with existing Typoscript patterns.

Before PAGEVIEW, TYPO3 integrators often used FLUIDTEMPLATE to build custom page layouts. While FLUIDTEMPLATE remains extremely powerful and flexible, it can feel “heavy” if you only need a simple rendering flow.
A typical FLUIDTEMPLATE setup might require defining:

  • Template Root Paths
  • Partial Root Paths
  • Layout Root Paths
  • Multiple variables and data processing
  • Conditional Typoscript logic for selecting templates

For small to medium projects, this can create a lot of repetitive configuration.
In contrast, a PAGEVIEW setup can quickly generate a page with minimal code. Here’s the difference in practice:

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_yoursite.paths.templates}
        }

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

        layoutRootPaths {
            100 = {$plugin.tx_yoursite.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
        }
    }
}

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

With PAGEVIEW, we achieve a comparable result in fewer lines, making it easier to maintain and adjust over time.

Implementing PAGEVIEW is straightforward. Below is a minimal example to get you started:

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

60 Lines of Code (with FLUIDTEMPLATE)

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_yoursite.paths.templates}
        }

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

        layoutRootPaths {
            100 = {$plugin.tx_yoursite.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
        }
    }
}
  • Configure the PAGE object as usual.
  • Assign PAGEVIEW to your page object.
  • Set the paths to tell PAGEVIEW where your template files live.

Pro Tip: If your project needs different layouts for different page types, you can still expand on PAGEVIEW by adding more Typoscript conditions or dynamic paths. However, avoid overcomplicating PAGEVIEW—if you find yourself writing complex logic, FLUIDTEMPLATE might be more appropriate.

  • Keep It Simple: PAGEVIEW is ideal for straightforward page templates. If you need advanced routing and dynamic templating logic, consider FLUIDTEMPLATE or a hybrid setup.
  • Leverage Data Processing: Data processing in PAGEVIEW is still supported, making it easy to inject menus or other dynamic data without heavy Typoscript.
  • Focus on Maintenance: Because PAGEVIEW setups are more concise, it’s simpler to troubleshoot any issues. Keep your Typoscript well-documented for future maintainers.
  • Consistency Matters: Use consistent naming conventions for variables and paths, just like you would with FLUIDTEMPLATE.

20 Lines of Code (with PAGEVIEW)

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

There are scenarios where FLUIDTEMPLATE remains more suitable:

  • Complex multi-layout sites requiring advanced template selection logic.
  • Highly customized content relying on deep custom variables or dynamic data beyond typical data processing.
  • Legacy codebases already deeply integrated with FLUIDTEMPLATE setups.

In such cases, FLUIDTEMPLATE offers robust features that PAGEVIEW intentionally avoids for simplicity’s sake.

The introduction of PAGEVIEW in TYPO3 v13 is a step toward making site development more efficient for integrators who need a quick, clean templating approach. If your site doesn’t demand the heavy lifting of FLUIDTEMPLATE, PAGEVIEW is definitely worth considering. With just a few lines of Typoscript, you can render fully functional pages while keeping your configuration tidy.

Ready to streamline your TYPO3 setup? Give PAGEVIEW a spin, and you’ll see how much time (and code) it can save. It’s yet another example of TYPO3 evolving to meet the needs of the community—focusing on ease-of-use without sacrificing the power and flexibility you’ve come to expect.

Feel free to let me know if you have any questions or need further clarifications about PAGEVIEW or any other TYPO3 features. 

Happy TYPO3 Coding!

Your One-Stop Solutions for Custom TYPO3 Development

  • A Decade of TYPO3 Industry Experience
  • 350+ Successful TYPO3 Projects
  • 87% Repeat TYPO3 Customers
TYPO3 Service
service

Post a Comment

×