DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: BE Layout Template

Created:2010-02-18T17:33:18
Changed by:Kai Vogel
Changed:2012-10-31T12:21:31
Classification:layouttemplate
Description:Adds a template selection field to backend layout records and link them with a FLUIDTEMPLATE for frontend output.
Keywords:backend, layout, template, FLUIDTEMPLATE, file
Author:Kai Vogel
Email:kai.vogel@speedprogs.de
URL:http://www.speedprogs.de
Language:en

img-1 img-2 EXT: BE Layout Template - layouttemplate

EXT: BE Layout Template

Extension Key: layouttemplate

Language: en

Keywords: backend, layout, template, FLUIDTEMPLATE, file

Copyright 2012, Kai Vogel, <kai.vogel@speedprogs.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

Table of Contents

EXT: BE Layout Template 1

`Introduction 3 <#__RefHeading__598_1315448058>`_

What does it do? 3

What should I have? 3

How can I use it? 3

How does it work? 3

Screenshots 4

`Installation 5 <#__RefHeading__178_421450792>`_

Install extension 5

Include static template 5

Make default setup 5

Modify root paths 5

Create pages 5

Create a backend layout 5

Add layout to a page 5

`TypoScript Constants 6 <#__RefHeading__8668_1069964170>`_

plugin.tx_layouttemplate.view 6

Example configuration 6

`Appendix 7 <#__RefHeading__9406_1069964170>`_

Known problems 7

`Changelog 8 <#__RefHeading__9421_1069964170>`_

Introduction

What does it do?

This extension adds a new field to the Backend layout records, which makes it possible to select a template file for the Frontend output. It uses the FLUIDTEMPLATE object the Frontend output and decides which template file will be used by reading it from the current page's backend layout record.

What should I have?

All you need are TYPO3 4.7 or newer and installed Extbase and Fluid extensions.

How can I use it?

Install the extension, load the static TypoScript template and make sure, that you do not overwrite the TypoScript path “ page.10 ”.

How does it work?

The FLUIDTEMPLATE object requires a template file for the rendering process. The extension provides a special TypoScript setup, which loads the path to template files from Backend layout records. This means, a page which uses a Backend layout will be rendered with the template file which is defined in this layout record.

If no template file was defined, the UID of the record will combined with the string “Template” and the ending “.html”. The resulting filename (e.g. Template1.html) will then be used as template file.

The filename “Template0.html” will be used if a page has no backend layout.

The layout / template / partial root path can be modified by using the “Constant Editor” or by modifying them manually via setup.

It is important that you change the path to a new one in your fileadmin directory instead of making changes in the extension directory.

Screenshots

img-3

Installation

Several steps are required to use the complete functionality of the gallery extension. Please follow the above steps in the defined order and enjoy the result.

Install extension

The BE Layout Template (layouttemplate) extension can be installed through the typical TYPO3 installation process by using the Extension Manager. If one of the following steps is missing, please clear all caches in backend.

Include static template

After installation switch to Template module in menu and go to your root page (this is normally the first page below the absolute root, formerly known as World globe) in page tree. Now choose “Info/Modify” in the dropdown in the upper left edge of the page. Finally open “edit the whole template record”, go to “Includes”-tab and select “BE Layout Template (layouttemplate)” in the list of static templates. Don't forget to save the dataset. Warning: The setup extends / overwrites existing TypoScript configuration in path “page.10”.

Make default setup

Klick on the pencil in front of the point “Setup” to open the TypoScript setup. Add at least the following line into the text field:

page = PAGE

All other template configuration is made by this extension. It also provides basic fluid template variables to display the content of first ten columns in your template. See the TypoScript setup in “Configuration/TypoScript/setup.txt” in extension root path for more details.

Modify root paths

Now open the Constant Editor by choosing “Constant Editor” in the dropdown in the upper left edge of the page. Select the category “BE LAYOUT TEMPLATE” in the second select on this page. Now change the three first constants to paths in your fileadmin directory. Don't forget to create this folders afterwards.

Create pages

Now create a new page in your page tree and name it as you like. We need also a new page with type “folder” to store our Backend layouts.

Create a backend layout

Now switch to the list module in menu and go to the newly created folder page. Add a new record from type “Backend Layout” and name it as you like. After setting up some columns in the “Config” field, select a template file in the previously created directory below fileadmin and save the record.

Add layout to a page

Edit the previously created page and select the new Backend layout for current page. You can now see the result by open this page in Frontend after saving it.

TypoScript Constants

All required configuration can be done in the constants via Constant Editor by modifying the following options.

plugin.tx_layouttemplate.view

templateRootPath

Property

templateRootPath

Data type

String

Description

Path to the template root path

Default

EXT:layouttemplate/Resources/Private/Templates/

partialRootPath

Property

partialRootPath

Data type

String

Description

Path to the partial root path

Default

EXT:layouttemplate/Resources/Private/Partials/

layoutRootPath

Property

layoutRootPath

Data type

String

Description

Path to the layout root path

Default

EXT:layouttemplate/Resources/Private/Layouts/

outputFormat

Property

outputFormat

Data type

String

Description

Ouput format

Default

html

[plugin.tx_layouttemplate.view]

Example configuration

This is an example configuration of the basic settings:

plugin.tx_layouttemplate {
  view {
    templateRootPath = fileadmin/Templates/
    partialRootPath  = fileadmin/Partials/
    layoutRootPath   = fileadmin/Layouts/
    outputFormat     = html
  }
}

Appendix

Known problems

Actually nothing. But if you know something, give me feedback via email.

Changelog

1.0.0

Version

1.0.0

Date

2012-10-31

Changes

Initial upload of the extension into TER

img-2 8