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: My Extension

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2008-02-13T14:25:24
Author:Author Name
Email:your@email.com
Info 3:
Info 4:

EXT: Generate a frontend URL from the backend

Extension Key: vara_feurlfrombe

Copyright 2008-2008, Omroepvereniging VARA, <webmaster@vara.nl>

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.com

Table of Contents

EXT: Generate a frontend URL from the backend 1

Introduction 1

What does it do? 1

Screenshots 2

Users manual 2

FAQ 2

Configuration 3

Reference 3

To-Do list 3

Changelog 3

Introduction

What does it do?

When an back end editor views a FE page from the back end, typo3 uses the default URL scheme to generate the front end URL. So if a page with id 123 is requested, typo3 will open the URL /index.php?id=123, regardless of simulate static or any other URL scheme which might have been configured.

This becomes a problem when a website uses simulate static and the back end users starts to use the URL they get from the back end to link to the website. Now we have two URL schemes combined: the simulate static URL from front end links, and the index.php?id=123 URL from the back end. It would be better if both the front end and the back end used the same URL scheme; however the only way to get a front end URL is to look up the page in the front end. By default it is not possible to generate the front end URL directly from the back end because the typo3 back end and front end are completely separated from each other in the typo3 core. This extension bypasses this limitation by using some ugly hacks to start up the typo3 front end engine from the back end. Now it's now possible to create simulate static URLs, or any other type of URLs from the back end.

Another feature is that it is now possible to edit a record (for example, a tt_news record), and directly save and view the news article. By default when a user clicks on the save/preview button typo3 opens up the page where the content element you have been working on is located. This works well for standard text elements, but (tt_news) records are usually located in a separated sysfolder, and previewing the record will therefor not work. This extensions can define a single view for news articles (or any other type of record), so when a back end user clicks on the save/preview button, the correct single view page is displayed.

I have tested this extension in typo3 version 3.8.1 and in 4.1.5.

Screenshots

Clickmenu

img-1 img-2

The click menu of a page in typo3 3.8 (left), and typo3 4.x (right), where the top button can be used to preview a page. This extension overrides the URL generated by this button.

Save / view page

img-3 img-4

Button to save the and view the currently opened record when viewed in typo3 3.8 (left), and typo3 4.x (right). This extension allows you to customize the URL where the record is viewed.

Users manual

When the extension is configured correctly, users will be able to use the click menu -> show function to view a page in the fronted with simulate static or any other URL scheme which is configured on the page, and the save / view function to view records in the fronted.

FAQ

Q: Why does this extension still sometimes return a URL with the default URL scheme (/index.php?id=123)

A: Not all page types can be loaded in the fronted engine of typo3. For example, spacers and sysfolders cannot generate their own URLs. Because these page types are generally not used for fronted content, it should not be much of a problem.

Configuration

The configuration of the page can be done entirely in typoscript. The default configuration includes basic functionality to generate tt_news single view URLs, and standard page URLs. You can expand this to include URLs to other types of records. You can indicate in the extension manager which page should be used to look up the typoscript configuration. The page you specify should be a normal page; it cannot be a sysfolder.

The configuration in typoscript is very flexible, but might be a bit hard to understand at first. Look at the ext_typoscript_setup.txt in the extension directory for the default typoscript configuration first. This will be the best starting point to see how you can define a single view page for the records of an extension.

By default the savepreview_url is configured as a COA, so you can add new entries to the list. I recommend you start at savepreview_url.100, so they don't interfere with the default configuration of the extension. You can copy one of the existing configuration to create a new configuration for an extension, as demonstrated in the default typoscript code.

You can change the typoscript configuration per page or choose a page in the extension manager configuration where the typoscript configuration is stored.

Reference

config.tx_varafeurlfrombe properties: TS configuration.

clickmenu_url

Property

clickmenu_url

Data type

cObject

Description

Generate the URL for the click menu show page item.

Default

TEXT

savepreview_url

Property

savepreview_url

Data type

cObject

Description

Generate the URL for the save / view button.

Default

COA

[tsref:config.tx_varafeurlfrombe]

((generated))
Example

To override the default single view page for tt_news articles (which is the single pid from the tt_news constants):

config.tx_varafeurlfrombe.savepreview_url.30.typolink.parameter = 123

Extension manager configuration:

templatepage

Property

templatepage

Data type

integer

Description

Specify a page to use for the typoscript configuration. If this is not specified the selected page is used to look up the typoscript configuration, which would cause problems on sysfolders.

Default

0

clickmenuxclass

Property

clickmenuxclass

Data type

boolean

Description

Enable / disable the XCLASS on the clickMenu class. Useful if you have another extension which also uses an XCLASS on this class, but of course this disables part of this extension.

Default

1

docxclass

Property

docxclass

Data type

boolean

Description

Enable / disable the XCLASS on the sc_alt_doc class. Useful if you have another extension which also uses an XCLASS on this class, but of course this disables part of this extension.

Default

1

To-Do list

- Nothing at this moment

Changelog

- Version 0.1.0: Initial upload.

img-5 EXT: Generate a frontend URL from the backend - 3