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.

page2tmpl

Author:Hans J. Martin
Created:2008-05-14T11:52:30
Changed by:Marcus Krause
Changed:2012-05-25T17:44:26
Classification:Templating
Author:Frank Nägler, Tom Rüther, Hans J. Martin, Marcus Krause, Kemal Emre
Email:typo3@e-netconsulting.de
Firma:e-netconsulting GmbH & Co. KG
URL:http://www.e-netcosulting.de/

page2tmpl

Extension Key: page2tmpl

Copyright 2000-2012, Frank Nägler, Tom Rüther, Hans J. Martin, Marcus Krause, Kemal Emre, <typo3@e-netconsulting.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

page2tmpl 1

Introduction 1

What does it do? 1

Screenshots 2

Users manual 2

Administration 2

Configuration 2

Reference 2

Tutorial 3

Known problems 5

To-Do list 5

Changelog 5

Introduction

What does it do?

Are you using extensions which need templates? Then this is nearly a must have for you!

Are you maintainer of a multi language site? Then stop wasting time and install page2tmpl right now!

Do you wish to grant different BE-users the right to edit some of the templates, e.g. for mail? Lucky you, you just found the right solution to make your life easier and let you sleep well at nights!

This extension introduces a revolutionary way for your administrators to manage the system. Basically this extensions enables you to use normal pages to be used as templates for your extensions.

For example if you are using an extensions like mailform, you have to create an (html)-template with markers. This might be pretty easy for you to do, but maybe the administrator/webmaster who will be in charge of the page afterwards doesn't even have a clue about how to edit files on the webserver. Now you can go on and tell him to just edit the special pages which generate the templates for e.g. mails.

You will experience the big advantage if managing a multi-language site with many e-mail-templates, e.g. an international e-commerce site. Now you can use the pretty good translation support even for e-mails. Think about your site-owner wants to change some formatting in the e-mails and you've got about 10 different languages. Yes, you can just do the classic way and edit all the templates manually – or you save lot's of time by just using this extension and let your site maintainer do all this fancy things by himself.

Features and Benefits
  • Edit templates for e-mails and other extensions directly in BE like other pages
  • Use the advanced multi language support of TYPO3 to ensure that templates are up to date in all languages
  • Use the TYPO3 rights system to let BE User edit (HTML)-Templates
  • Let the editor see previews of e-mail templates directly like every other pages

Screenshots

img-1 This is could be a typical site structure with page2tmpl

img-2

Now it is quiet easy to keep your e-mail templates for different languages in sync – the build in TYPO3 language supports tracks changes in the standard languages and high lites changed contents.

Users manual

So, you are in charge of a website and have to edit some templates for e-mails or some advanced plugins like mailform or commerce? Lucky you – it seems that your administrator has installed page2tmpl on your site.

First locate the sysfolder under which you should find the pages for the templates.

Now go to the pages which are used for the extensions. Your administrator should give you some hints on finding the right page.

Edit the page like every other page. Most likely there will be some special markers which you should include in your page, e.g. ###username###. Please check the manual to your site

Administration

To let the pages being generated you have to enter some page TSConfig on all the pages which contain the templates. On each site containing a template the PageTSConfig “ config.page2tmpl.path ” must be set containing the path for the templates which will be created.

The templates will be created with the name given, extended by “_[pageType]_[languageUid]”. The pagetype is only set if there are different page types defined.

By extending the template filenames you can easily configure your plugins with typoscript to use the template which fits to your language and or page type.

Moreover you can of course grant different access / rights to the pages to different backend users.

You can configure page2tmpl to generate page templates only, if the “Save Page to Template” checkbox is set, when saving the page record in the backend, instead of updating it on every change to the page or its content elements. Check “Evaluate page record checkbox”, in the Configuration of page2tmpl in the Extension-manager, to enable it.

Configuration

Basically configuration must only be done for the extensions you are using. In fact, the thing you have to do is to set the right template for each extension, as described in the Administration-section.

Expecting more? Well, you will have to configure some nice TStemplates for your pages containing the templates, as e.g for mailtemplates there might be the need for special (to be more exactly: nearly none) styling.

Reference

- Possible subsections: Reference (TSConfig)

path

Property

path

Data type

string

Description

Path used to store templates created from page

Default

name

Property

name

Data type

string

Description

Name of the template file which will be created from the page. If a language is defined, the name will be extended with _[language_uid]

Default

The uid of the page

type

Property

type

Data type

Integer

Description

Page-type used for generating the template. If set, the template-name will be extended with _[typeID]

Default

0

[tsconfig:config.page2tmpl]

((generated))
Example
config.page2tmpl {
        path = fileadmin/
        name = mytemplate
        type = 99
}

Tutorial

First go to the extension manager and install the extension:

img-3 open the extension-manager

The page2tmpl extension will be shown. Go on and click on the install button to get the extension onto your system

img-4 Now it's time to create an page structure for our needs. First start with creating an sysfolder in your tree Important Please select “page2template” in the section “contains plugin:” as the hook for rendering the pages to templates will only work if a page with this setting is found in the rootline. You might notice, that the icon of the sysfolder also changes to a new look.

N img-5 ow go on and create some pages which you need for your templates, e.g. mailform, shop order etc.In this example the first page for templates is “Email registration success”We do need to do some special configuration on this site. So please go to the TSconfig section and enter the path and filename for the template: img-6

img-7 Create some content on one of the template page. Don't forget to insert some markers. Hint: It might be useful to copy all markers of the original template of the extension into an internal note and write some comments. This will make the life of your editors easier and might prevent your telephone from some calls...To create an internal note click on the page which will be used for the template and select “internal note”

img-8 img-9

Edit the page which will be used to render the content again and save the page. While the page is being saved, the templates will be created. If enabled, the “Save Page to Template” checkbox has to be activated, while saving the page, to generate the templates.

Go on and configure the extension you would like to use with page2tmpl. Select the template which fits your language for the extension, e.g. fileadmin/mytemplate_5

Now you are done – but don't forget that you might also have to create a special template, e.g. for the mail-templates.

Known problems

- As of today there are no known problems

To-Do list

Define markers for the rte/extensions to allow editors to insert markers predefined by the administrator

Create some function to put get parameters for extensions in the template, e.g. for generating a template containing ttnews plugin which should only show one special record.

More and maybe better screenshots for the doc

Some more examples for the docs, e.g. for multilanguage multiformat sites.

Changelog

* Initial release

2012-05-25 Kemal Emre <kemal.emre@e-net.info>

* Added Information and Screenshot about new “Save Page to Template” checkbox

page2tmpl - 5

img-10