.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt .. role:: underline ============================ Browser Tutorial Marker (en) ============================ :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed: 2010-10-31T21:06:07 :Classification: browser_tut_marker_en :Description: This is the Marker Tutorial for the Extension Browser - the Frontend Engine. :Keywords: forAdmins, forDevelopers, forBeginners, forIntermediates, forAdvanced, browser, tutorial, marker :Author: Dirk Wildt, Die Netzmacher :Email: wildt.at.die-netzmacher.de :Website: http://die-netzmacher.de :Language: en |img-1| |img-2| extKey: browser\_tut\_marker\_en |img-3| .. _Browser-Tutorial-Marker-en: Browser Tutorial Marker (en) ============================ |img-4| Version: 3.5.0, 2010-10-31 Extension Key: browser\_tut\_marker\_en - Tutorials for the extension Browser (extkey: browser) Language: en Keywords: forAdmins, forDevelopers, forBeginners, forIntermediates, forAdvanced, browser, tutorial, marker Copyright 2009-2010, Dirk Wildt, Die Netzmacher, 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: Table of Contents ----------------- `Browser Tutorial Marker (en) 1 <#__RefHeading__32554_603351207>`_ `Introduction 3 <#__RefHeading__32556_603351207>`_ `What does it do? 3 <#__RefHeading__32558_603351207>`_ `Marker Overview 4 <#__RefHeading__32560_603351207>`_ `Definition 4 <#__RefHeading__32562_603351207>`_ `Default 4 <#__RefHeading__32564_603351207>`_ `Database Marker 4 <#__RefHeading__32566_603351207>`_ `Constant Marker 4 <#__RefHeading__32568_603351207>`_ `System Marker 4 <#__RefHeading__32570_603351207>`_ `piVars Marker 4 <#__RefHeading__32572_603351207>`_ `TYPO3 $GLOBALS Marker 4 <#__RefHeading__32574_603351207>`_ `Default 5 <#__RefHeading__32576_603351207>`_ `Schematic Work Flow without any own Marker 5 <#__RefHeading__32578_603351207>`_ `Database Marker 6 <#__RefHeading__32580_603351207>`_ `Screenshot 6 <#__RefHeading__32582_603351207>`_ `Code 6 <#__RefHeading__32584_603351207>`_ `Schematic Work Flow 7 <#__RefHeading__32586_603351207>`_ `Select Box for Ordering 8 <#__RefHeading__32588_603351207>`_ `List View 9 <#__RefHeading__32590_603351207>`_ `Single View 10 <#__RefHeading__32592_603351207>`_ `Constant Marker 11 <#__RefHeading__32594_603351207>`_ `Use your own constants 11 <#__RefHeading__32596_603351207>`_ `Default 11 <#__RefHeading__32598_603351207>`_ `System Marker 13 <#__RefHeading__32600_603351207>`_ `With Relevance for Your Design 13 <#__RefHeading__32602_603351207>`_ `With less Relevance 13 <#__RefHeading__32604_603351207>`_ `List View 13 <#__RefHeading__32606_603351207>`_ `Single View 13 <#__RefHeading__32608_603351207>`_ `cHash 14 <#__RefHeading__32610_603351207>`_ `piVars Marker 15 <#__RefHeading__32612_603351207>`_ `Screenshots 15 <#__RefHeading__32614_603351207>`_ `Code 15 <#__RefHeading__32616_603351207>`_ `TYPO3 $GLOBALS Marker 16 <#__RefHeading__32618_603351207>`_ `Case Sensitive! 16 <#__RefHeading__32620_603351207>`_ `Plugin 16 <#__RefHeading__32622_603351207>`_ `Screenshot 16 <#__RefHeading__32624_603351207>`_ `Code 17 <#__RefHeading__32626_603351207>`_ `More Information 18 <#__RefHeading__32628_603351207>`_ `Wrapping Fields 19 <#__RefHeading__32630_603351207>`_ `Templating 20 <#__RefHeading__7409_1650786976>`_ `Reference 21 <#__RefHeading__32632_603351207>`_ `Further Information 22 <#__RefHeading__32634_603351207>`_ `This tutorial in PDF format 22 <#__RefHeading__32636_603351207>`_ `Browser Manual and Browser Tutorial Basics 22 <#__RefHeading__32638_603351207>`_ `Forum 22 <#__RefHeading__32642_603351207>`_ `Helpful suggestions 23 <#__RefHeading__32646_603351207>`_ `To-Do List 24 <#__RefHeading__32648_603351207>`_ `Change Log 25 <#__RefHeading__32650_603351207>`_ `Illustration Index 26 <#__RefHeading__32652_603351207>`_ .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ |img-5| Illustration 1: Tutorial in PDF This is a tutorial for the extension Browser (extkey: browser). It is a step-by-step introduction for using markers in TypoScript only. .. _Marker-Overview: Marker Overview --------------- .. _Definition: Definition ^^^^^^^^^^ Every marker is wrapped in ###. Markers are written in uppercase in the HTML template like: ###TT\_NEWS.TITLE### Markers are written in lowercase in TypoScript like: ###tt\_news.title### Only TYPO3 $GLOBAL markers are case sensitive. Every marker is an object. It has the TypoScript stdWrap property. You can use every marker as COA object for example. You can every marker extend with other TypoScript objects like TEXT, IMAGE or COA among others. The Browser will replace markers with their corresponding values at runtime. The Browser provides five kinds of markers: - database marker - constant marker - system marker - piVars marker - TYPO3 $GLOBALS marker .. _Default: Default ^^^^^^^ If you are interested in a list and single view without any configuration, you don't need to use any marker. You need some lines TypoScript only. You need markers only - if you want to change or wrap values at runtime, - if you like your own layout. .. _Database-Marker: Database Marker ^^^^^^^^^^^^^^^ You can place every value from the database of your extension into the HTML template with a database marker. Databse markers have the table- dot-field format like ###TT\_NEWS.TITLE###. .. _Constant-Marker: Constant Marker ^^^^^^^^^^^^^^^ You can place every constant value in your HTML template as a constant marker. The constant marker has the stdWrap property. .. _System-Marker: System Marker ^^^^^^^^^^^^^ The Browser provides some system markers: - TITLE - TEXT - IMAGE - ITEM They have special properties. .. _piVars-Marker: piVars Marker ^^^^^^^^^^^^^ You have access to the value of every piVar with a piVar marker at runtime. .. _TYPO3-GLOBALS-Marker: TYPO3 $GLOBALS Marker ^^^^^^^^^^^^^^^^^^^^^ TYPO3 enables the access to hundreds and thousands of variables by the array $GLOBALS. The Browser enables the access to this array with the TYPO3 $GLOBALS marker at runtime. .. _Default: Default ------- The Browser is able to build default lists and default single views. You need one line TypoScript for generating a list only. .. _Schematic-Work-Flow-without-any-own-Marker: Schematic Work Flow without any own Marker ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Below we have illustrated a schematic work flowfor a list with tt\_news titles and categories. .. _Title: Title """"" |img-6| The marker ###MY\_TITLE### will be replaced with the value from the title field of the Browser plugin The default HTML template (cutout) contains the marker ###MY\_TITLE###. The result: ###MY\_TITLE### is replaced with "News" .. _Items: Items """"" |img-6| tt\_news.title and tt\_news\_cat.title in your TypoScript The two ###item### markers in the subparts LISTHEADITEM and LISTBODYITEM. The frontend with the two rows news title and category title. .. _Database-Marker: Database Marker --------------- |img-7| Illustration 4: Individual desigend list view If you like your own individual layout, you should use database markers in your HTML template. We like to call them TABLE.FIELD marker too, because of the format: ###TABLE.FIELD### Example: - HTML: ###TT\_NEWS.TITLE### - TypoScript: ###tt\_news.title### .. _Screenshot: Screenshot ^^^^^^^^^^ We like to display in our HTML template a list of news with - the title, - an image, - the short description and - the category. See the illustration on the right hand. .. _Code: Code ^^^^ .. _TypoScript: TypoScript """""""""" plugin.tx\_browser\_pi1 { views { list { 1 { select ( **tt\_news.title,** **tt\_news.image,** **tt\_news.imagealttext,** **tt\_news.imagetitletext,** **tt\_news.short,** **tt\_news\_cat.title** ) } } } } .. _HTML: HTML """" Cutout ###MY\_TITLE### ...
###ITEM### **
** **
** **###TT\_NEWS.IMAGE###** **
** **
** **

###TT\_NEWS.TITLE###

** **
    ** **
  • ** **###TT\_NEWS\_CAT.TITLE###** **
  • ** **
  • ** **###TT\_NEWS.SHORT###** **
  • ** **
** **
** **
** **
**
.. _Schematic-Work-Flow: Schematic Work Flow ^^^^^^^^^^^^^^^^^^^ |img-6| You have defined in the select property of your TypoScript all table.fields, you want to display in the frontend. You have created your own HTML with the database markers in the section ###LISTBODYITEM###. The result in the frontend. Hint If you want to display images and you use the fields imagealttext and imagetitletext in your select query like in the example above, the Browser will wrap them as the HTML image alt tag and title tag automatically. .. _Select-Box-for-Ordering: Select Box for Ordering ^^^^^^^^^^^^^^^^^^^^^^^ |img-6| If you remove the ###ITEM### marker in the section ###LISTBODYITEM### in your HTML template, the Browser will replace the ###ITEM### marker in ###LISTHEADITEM### with a select box for ordering. .. _TypoScript-Object-Browser: TypoScript Object Browser """"""""""""""""""""""""" |img-6| Cutout: plugin.tx\_browser\_pi1 { displayList { selectBox\_orderBy { templateMarker = ###TEMPLATE\_SELECTBOX### selectbox = SELECTBOX selectbox { ... } } } } .. _orderBy: orderBy """"""" If you like a individual order, please use this snippet (see Browser reference "orderBy"): plugin.tx\_browser\_pi1.views.list { 1 { select = ... orderBy = tt\_news.datetime desc, tt\_news\_cat.title } } .. _Labeling: Labeling """""""" If you like to label the field names, please take a look into Browser Tutorial Labeling - HTTP: `http://typo3.org/documentation/document-library/extension- manuals/browser\_tut\_labeling\_en/current/ `_ - PDF: `http://typo3.org/extensions/repository/view/\_tut\_labeling\_en/ current/info/?tx\_terfe\_pi1%5BdownloadFile%5D=doc%252Fmanual.pdf `_ .. _List-View: List View ^^^^^^^^^ The instructions above are for a list view. The principle for single views is similar. See the section below. .. _Single-View: Single View ^^^^^^^^^^^ .. _Default-Design: Default Design """""""""""""" Cutout for the default design. with the ###VALUE### marker: ... ###FIELD### ###VALUE### ... .. _Individual-Design: Individual Design """"""""""""""""" Cutout for an individual design with database markers: ...

###TT\_NEWS.TITLE###

###TT\_NEWS.IMAGE###
  • ###TT\_NEWS\_CAT.TITLE###
  • ###TT\_NEWS.SHORT###
... .. _Constant-Marker: Constant Marker --------------- A constant marker may have any name, there is no precondition. The name of a constant marker has to be unique. And please don't use system markers like ###ACTION###, ###VIEW###. And please don't confuse yourself: do not call a constant in the table.field syntax like ###TT\_NEWS.TITLE###. It is a good idea to use the prefix ###MY\_... like ###MY\_OWN\_MARKER###. .. _Use-your-own-constants: Use your own constants ^^^^^^^^^^^^^^^^^^^^^^ You can use your own constants in every HTML template. Every constant marker is an object, it has the TypoScript stdWrap property. Constant markers are very helpful, if you need a constant depending on other values or properties like the current language for example. .. _Default: Default ^^^^^^^ .. _HTML-Template: HTML Template """"""""""""" The deafult HTML template uses three constant markers: - ###MY\_TITLE### - ###MY\_URL### - ###MY\_RESET### You find it in the file res/default.tmpl **###MY\_TITLE###**