.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt :Created: 2007-10-04T18:32:32 :Changed by: Alban Cousinié :Changed: 2009-05-11T13:14:22.170000000 :Author: Author Name :Email: your@email.com :Info 3: :Info 4: .. _EXT-Templavoila-XML-for-Flash: EXT : Templavoila XML for Flash =============================== Extension Key: **tv\_xml\_for\_flash** Copyright 2009, Alban Cousinié, 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 : Templavoila XML for Flash 1** **Introduction 1** What does it do? 1 Screenshots 2 **Users manual 4** FAQ 8 **Adminstration 8** FAQ 8 **Configuration 8** FAQ 10 Reference 10 **Tutorial 10** **Known problems 10** **To-Do list 10** **Changelog 11** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ There already exists several extensions capable of outputing Typo3 content to XML so it can be read by flash, but none supports templavoila and I found they were not stable enough to rely on them for production purposes. This extension is capable of exporting the whole page tree as XML and the whole content of a given typo3 page including flexform data. It exports ALL information i could gather from 'pages' and tt\_content tables, thus generates pretty big XML files (they still load quickly though since there are no images), but in return you can make use of almost any typo3 information from flash, such as controlling if a page has a start / stop date, sorting information, creation date etc... Several types of flexform fields are recognized during and processed in order to be reverted from their Typo3 custom internal format to a format usable externaly. Currently the extension knows how to deal with the following flexform editing types (eTypes) : - bodytext edited with RTE including all type of links (open window, file link, internal link, external link). Images embeded from inside the RTE are not tested and likely not to be supported. Anyway I don't think flash supports including an image inside a text field. - Input text - image input - link input - content element It is easy to customize the PHP code in order to deal with more type of objects as explained in this documentation, but I haven't had enough time to cover all eTypes of contents present in typo3. The eTypes provided in standard should already cover most usages. If you add some content types, please send me your code so I can integrate it into the extension for the benefit of the community. This extension is capable of dealing with multiple web sites and multiple languages. **Important :** **web sites making use of this extension should have Typo3 and their mysql database configured for utf-8, as flash doesn't handle properly non utf-8 content.** .. _Screenshots: Screenshots ^^^^^^^^^^^ These websites are making use of tv\_xml\_for\_flash : Leisure park Vulcania : `http://www.vulcania.com `_ |img-1| Agence Bande à part : `http://www.bandeapart.fr `_ |img-2| This is a part of the XML output of the page structure : |img-3| This is a part of the XML output of a page data : |img-4| .. _Users-manual: Users manual ------------ Once the extension is installed and configured it can be used as is (notice the page type set by default for this extension is 555) This will of course load your regular web page with your flash template : `http://www.mydomain.com/index.php?id=25 `_ Now from the flash you can retrieve the content data associated with page id 25 using the following URL : `http://www.mydomain.com/index.php?id=25&type=555 `_ You can also retreive the page tree as XML using the following URL : `http://www.mydomain.com/index.php?id=25&type=555&action=getPageTree < http://www.mydomain.com/index.php?id=25&type=555&action=getPageTree>`_ Retreiving the page tree as XML using the siteMenu.xml file is now deprecated and no longer works since version 0.9 `http://www.mydomain.com/typo3conf/ext/tv\_xml\_for\_flash/res/siteMen u.xml `_ `[DEPRECATED] `_ .. _generated: ((generated)) ^^^^^^^^^^^^^ .. _Base-actionscript-code-you-may-want-to-use-as-a-start-for-loading-XML-content: Base actionscript code you may want to use as a start for loading XML content : """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" See the new actionscript 3.0 API + preloader located in the /res/Flash\_AS3\_Typo3\_API directory of the extension (in typo3conf/ext/tv\_xml\_for\_flash/) .. _Structure-of-the-XML-for-page-description: Structure of the XML for page description """"""""""""""""""""""""""""""""""""""""" Here is a simplified output of a page layout featuring 2 content areas : column1 and column2 :: 0 //this is the current sys_language_uid displayed in the frontend 29 | Page attributes listing | //here we start listing the content elements in the page //first content element in the page template 264 | secondary importance attributes listed here | //when bodytext is typed it appears in this attribute, as it is not recorded in the database as a flexform element This is a bodytext typed in the RTE | secondary importance attributes listed here | //here you may find some flexform elements. Look in column_2 how they appear | //second content element in the page template 334 //here we have flexforms ! 143 | secondary importance attributes listed here | //we have a nested content element here ! //here are the attributes from a flexform //notice the fields in green are named as in your flexform data structure specification //this is a file link fileadmin/my-file.mp3 //this is input text Spot radio Vulcania #1 256 //this is an image uploads/tx_templavoila/poste-radio.jpg | secondary importance attributes listed here | .. _Structure-of-the-XML-for-page-tree: Structure of the XML for page tree """""""""""""""""""""""""""""""""" This is a page tree XML stripped and formated for readability. I have left all attributes for the first page, but removed most attributes on following pages. Most interesting attributes are commented. Some I have not commented may interest you as well. :: **Important note :** Since version 0.9, the count of fields output in the XML file can be reduced to only the fields needed. This can be done by editing the file stripedKeys.php in the extension forler for this purpose and specify there the useless fields that should not be output. Most useless fields are now already stripped by default. .. _FAQ: FAQ ^^^ None yet. .. _Adminstration: Adminstration ------------- Usage of this extension is only targeted at web developers, and there are not administration requirements. .. _FAQ: FAQ ^^^ None yet. .. _Configuration: Configuration ------------- - Install the extension. - In the extension settings (in the ext manager, click on the extension name), set the **Site root uid** value to the page Id of the root of the website you want to publish as XML. Currently this extension is limited to publish only one website. logically, you should be using templavoila, so the Typoscript setup of your site root page should at least feature the following lines : :: //we are using templavoila page = PAGE page.typeNum = 0 page.config.doctype = xhtml_trans page.10 = USER page.10.userFunc = tx_templavoila_pi1->main_page //remember flash requires utf-8 config.metaCharset = utf-8 config.renderCharset=utf-8 if you want to modify the pageType for the XML generated content, set the following line in your typoscript setup : :: // setting the page type to 888 extension.tv_xml_for_flash.XMLPageContent = 888 Inserting the flash file in your template : :: ############################################################## # Transmit Typo3 variables thru javascript ############################################################## page = PAGE page{ headerData{ 10=HTML 10.value( ) //Passing required Typo3 variables to the javascript 20 = COA 20{ 10=HTML 10.value= } } } //transmit current page pid and uid values page.headerData.20.40.data = page:uid page.headerData.20.44.data = page:pid ############################################################## # Multi-language adjustments ############################################################## // Netherlands language [globalVar = GP:L = 3] config { sys_language_uid = 3 language = nl locale_all = nl_NL htmlTag_langKey = nl-NL } page.headerData.20.80.value = 3 [END] // German language [globalVar = GP:L = 4] config { sys_language_uid = 4 language = de locale_all = de_DE htmlTag_langKey = de-DE } page.headerData.20.80.value = 4 [END] //update language key in javascript variable in page header page.headerData.20.20.value < config.language ############################################################## # Multi-site adjustments ############################################################## //site principal [PIDinRootline = 2] config.baseURL = http://www.vulcania.com/ page.headerData.20.56.value = 0 page.headerData.20.60.value = 2 [end] //site education [PIDinRootline = 51] config.baseURL = http://education.vulcania.com/ page.headerData.20.56.value = 1 page.headerData.20.60.value = 51 [end] ############################################################## # REAL URL adjustments ############################################################## config.tx_realurl_enable = 1 page.headerData.20.48.value < config.tx_realurl_enable page.headerData.20.52.value < config.baseURL Then insert you FLASH file either using typoscript or by putting it natively in your XHTML template HTML code. **Notice 1 :** usage of swfobject is recommended as it generates less code and is very intuitive to use. **Notice 2 :** don't forget to pass the typo3 parameters to the flash applet using javascript ::
Now you should be able to insert some bodytext in some content area you have defined in your template and the text should show up in the XML when you call your page with the parameter &type=555 .. _generated: ((generated)) ^^^^^^^^^^^^^ .. _How-to-create-Flexforms-for-use-with-the-extension: How to create Flexforms for use with the extension ? """""""""""""""""""""""""""""""""""""""""""""""""""" Simply create a basic HTML file featuring attributes so you can map the data of your interest. For example, here is the flexform template for the MP3 flexform featured in the page sample XML format described above : ::
The top div is required so you can map the root of the flexform data structure on it. Our file is an MP3, but we have used an tag here because templavoilà would not let us map a custom html field . Anyway we don't care since this flexform is not intended to be output to HTML : our interest goes to the fields recorded in the database so they can be output to XML. Then the fields are mapped as is : |img-5| .. _FAQ: FAQ ^^^ How do I add custom processing for an unsupported eType ? Look in the file typo3conf/ext/tv\_xml\_for\_flash/XMLPageContent.php around line 509 to figure how supported editing types are processed. Then make your own processing, and don't forget to send it to us for sharing with the community. In order to know the right syntax for the etype name testing like if($DS\_definition[$key]['eType']=="rte"){},look the datastructure XML of your flexform for the content of the tag you want to process correctly. The tag should contain the internal Typo3 name for the eType which you should be testing against. .. _Reference: Reference ^^^^^^^^^ .. _Tutorial: Tutorial -------- .. _Known-problems: Known problems -------------- - Multi language has not been tested with single tree scheme, only separate tree is tested and aproved - Flexforms of type “container” are not supported - Some Flexforms eTypes are missing and remain unsupported .. _To-Do-list: To-Do list ---------- - Support all Typo3 eTypes - Improve XML tab formating (could it be passed thru tidy for automatic indentation?) - Test single tree multiple language model support - Move stripedKeys specification to typoscript setting - Caching of XML content as text files would be nice .. _Changelog: Changelog --------- - - Version 0.9 (release date 11/05/2009) : - WARNING : breaks compatibility with version 0.8 !!! Sitemap.xml no longer supported. Use the &getPageTree parameter instead. - Now compatible with actionscript 3.0 + small typoscript 3.0 API supplied in the extension directory - now supports multiple websites and multiple languages (separate tree model tested only) - removed support for sitemap.xml static file due to multiple language support - links output as realURLs in the sitemap when realurl is enabled - fixed the following problem : when 2 images in the website have the very same name, the image processing function which remaps the image path from the database information may return path to the wrong image if found first in the database entries of the sys\_refindex table. - Many other small bugfixes I don't remember of.. - Allows optimization of XML content files by allowing to disable output of unwanted database fields (edit file stripedKeys.php in the extension forler for this purpose and specify there the useless fields that should not be output). Version 0.8 : First release (release date : 05/10/2007) |img-6| - 12 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 425 .. :id: graphics1 .. :name: graphics1 .. :width: 669 .. |img-2| image:: img-2.jpeg .. :align: left .. :border: 0 .. :height: 523 .. :id: Image1 .. :name: Image1 .. :width: 621 .. |img-3| image:: img-3.jpeg .. :align: left .. :border: 0 .. :height: 437 .. :id: Image2 .. :name: Image2 .. :width: 616 .. |img-4| image:: img-4.jpeg .. :align: left .. :border: 0 .. :height: 435 .. :id: Image3 .. :name: Image3 .. :width: 622 .. |img-5| image:: img-5.png .. :align: left .. :border: 0 .. :height: 457 .. :id: Image4 .. :name: Image4 .. :width: 652 .. |img-6| image:: img-6.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102