.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ================= 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: EXT: Generate a frontend URL from the backend ============================================= Extension Key: **vara\_feurlfrombe** Copyright 2008-2008, Omroepvereniging VARA, 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: 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: Introduction ------------ .. _What-does-it-do: 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: Screenshots ^^^^^^^^^^^ .. _Clickmenu: 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: 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: 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: 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: 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: Reference ^^^^^^^^^ **config.tx\_varafeurlfrombe properties: TS configuration.** .. ### BEGIN~OF~TABLE ### .. _clickmenu-url: clickmenu\_url """""""""""""" .. container:: table-row Property clickmenu\_url Data type cObject Description Generate the URL for the click menu show page item. Default TEXT .. _savepreview-url: savepreview\_url """""""""""""""" .. container:: table-row Property savepreview\_url Data type cObject Description Generate the URL for the save / view button. Default COA .. ###### END~OF~TABLE ###### [tsref:config.tx\_varafeurlfrombe] .. _generated: ((generated)) """"""""""""" .. _Example: 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: .. ### BEGIN~OF~TABLE ### .. _templatepage: templatepage '''''''''''' .. container:: table-row 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: clickmenuxclass ''''''''''''''' .. container:: table-row 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: docxclass ''''''''' .. container:: table-row 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 .. ###### END~OF~TABLE ###### .. _To-Do-list: To-Do list ---------- \- Nothing at this moment .. _Changelog: Changelog --------- \- Version 0.1.0: Initial upload. |img-5| EXT: Generate a frontend URL from the backend - 3 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 253 .. :id: graphics1 .. :name: graphics1 .. :width: 158 .. |img-2| image:: img-2.png .. :align: left .. :border: 0 .. :height: 174 .. :id: graphics2 .. :name: graphics2 .. :width: 134 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 17 .. :id: graphics3 .. :name: graphics3 .. :width: 22 .. |img-4| image:: img-4.png .. :align: left .. :border: 0 .. :height: 17 .. :id: graphics4 .. :name: graphics4 .. :width: 18 .. |img-5| image:: img-5.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102