SlideShare ist ein Scribd-Unternehmen logo
1 von 50
typofaktum
                                                       unternehmenskommunikation




                                  stdWrap
                                für Anfänger
                            TypoScript - von Anfang an - Teil II

                          05. Mai 2009 - TYPO3 Usergroup München
                                  Patrick Lobacher
                                                             Inspiring people to
    TypoScript II: stdWrap für Anfänger                      share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          Was kann TypoScript?



                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                          unternehmenskommunikation



                „Normales“ TypoScript
                          Setzen von Werten (Zuweisung)
                          Kopieren und Referenzieren von Werten
                          Ausklammern
                          Conditions
                          Objekte (TLO und Content-Objekte)



                                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger                         share
Montag, 17. August 2009
typofaktum
                                                                             unternehmenskommunikation



                „Normales“ TypoScript
                          page = PAGE
                          page {
                            10 = TEMPLATE
                            10 {
                              template = FILE
                              template.file = fileadmin/templates/index.html
                              workOnSubpart = DOCUMENT
                              marks {
                                 ...
                              }
                            }
                          }




                                                                                   Inspiring people to
    TypoScript II: stdWrap für Anfänger                                            share
Montag, 17. August 2009
typofaktum
                                                                  unternehmenskommunikation



                Häufige Aufgaben
                          Ermittlung von Daten (Datenbank, ...)
                          Berechnen von Werten
                          Formatieren von Werten
                          Ausgabe von Werten, abhängig vom Ergebnis von
                          Abfragen (if)
                          Zerlegung von Texten
                          => nicht machbar mit “normalem“ TypoScript

                                                                        Inspiring people to
    TypoScript II: stdWrap für Anfänger                                 share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          Die Lösung: stdWrap



                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




              Das
           Schweizer
            Messer
              des
          TypoScripts
                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                    unternehmenskommunikation



                Was ist stdWrap??
                          Unklar woher der Name kommt -
                          ausgesprochen „Standard Wrap“
                          Herkunft vom Wrap-Konzept: abc | def
                          stdWrap ist ein Konzept, hinter dem
                          zahlreiche nützliche (PHP)-Funktionen
                          stehen, die Daten ermitteln, Daten
                          überschreiben und Daten verarbeiten.

                                                          Inspiring people to
    TypoScript II: stdWrap für Anfänger                   share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                ACHTUNG TECHNIK!
                          Für stdWrap verantwortliche Datei in TYPO3:
                          typo3/sysext/cms/tslib/class.tslib_content.php
                          Alle möglichen Funktionen sind dort definiert
                          Die dortige Reihenfolge ist entscheidend
                          Momentan 76 Funktionen im stdWrap-
                          Baukasten

                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                ACHTUNG TECHNIK!




                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          Referenz??



                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                TSref

                          www.tsref.net
                          DIE Referenz
                          Abschnitt 1.5
                          Functions
                          stdWrap
                          Abschnitt 1.2
                          Data types

                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                Auszug aus TSref




                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                     unternehmenskommunikation



                TSref - Datentyp
                          Mögliche Werte für eine TS-Eigenschaft
                          Datentyp /stdWrap

                          Erwartet einen Wert vom Typ
                          „Datentyp“ (z.B. String, HTML,
                          Integer, ...).
                          Zusätzlich können DARAUF stdWrap-
                          Funktionen angewendet werden.
                                                           Inspiring people to
    TypoScript II: stdWrap für Anfänger                    share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          Einfache Beispiele



                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                Einfaches HTML-Objekt - 1
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Hello Usergroup!


                          Ausgabe:
                          Hello Usergroup!




                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                Einfaches HTML-Objekt - 2
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Hello Usergroup!
                          page.10.value.case = upper


                          Ausgabe:
                          HELLO USERGROUP!



                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                                          unternehmenskommunikation



                Einfaches HTML-Objekt - 3
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Hello Usergroup!
                          page.10.value.wrap = Welcome! | Ciao!


                          Ausgabe:
                          Welcome!Hello Usergroup!Ciao!



                                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger                         share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                Einfaches HTML-Objekt - 4
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Hello Usergroup!
                          page.10.value.crop = 5 | ...


                          Ausgabe:
                          Hello...



                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                Einfaches HTML-Objekt - 4




                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                Einfaches HTML-Objekt - 4
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Munich
                          page.10.value.wrap = Hello | Usergroup
                          page.10.value.crop = 5 | ...




                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                Einfaches HTML-Objekt - 4
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Munich
                          page.10.value.wrap = Hello | Usergroup
                          page.10.value.crop = 5 | ...


                          Ausgabe:
                          Hello...


                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                Einfaches HTML-Objekt - 4
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Munich
                          page.10.value.wrap = Hello | Usergroup
                          page.10.value.crop = 5 | ...


                          Ausgabe:
                          Hello...
                          HelloMunic...Usergroup ✔
                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          stdWrap Systematik



                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                           unternehmenskommunikation



                stdWrap - Arten
                          Get data - Daten ermitteln
                          (field, data, ...)
                          Override / Conditions - Überschreiben und IF
                          (override, if, required, stdWrap,...)
                          Parse data (Parsen und Verändern)
                          (split, prioriCalc, case, crop, wrap, ...)


                                                                 Inspiring people to
    TypoScript II: stdWrap für Anfänger                          share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          stdWrap Get Data



                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                 unternehmenskommunikation



                Get data
                          setContentToCurrent   current
                          setCurrent            cObject
                          lang                  numRows
                          data                  filelist
                          field                  preUserFunc


                                                       Inspiring people to
    TypoScript II: stdWrap für Anfänger                share
Montag, 17. August 2009
typofaktum
                                                         unternehmenskommunikation



                Get data - field
                          Ermittelt den Wert eines Datenbankfeldes aus
                          dem aktuellen Context
                          Context beim PAGE-Objekt ist die Tabelle pages
                          In dem Fall können sämtliche Elemente der
                          Seiteneigenschaften ermittelt werden
                          Wenn nichts anderes angegeben wurde, werden
                          die Daten der aktuellen Seite ermittelt

                                                               Inspiring people to
    TypoScript II: stdWrap für Anfänger                        share
Montag, 17. August 2009
typofaktum
                                                           unternehmenskommunikation



                Get data - field
                          page = PAGE
                          page.10 = HTML
                          page.10.value.field = title


                          Gibt den Seitentitel der aktuellen Seite aus
                          Problem: Wie heissen die anderen Felder?



                                                                 Inspiring people to
    TypoScript II: stdWrap für Anfänger                          share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                Get data - field




                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                Firebug
                Ermittlung des
                Feldes
                „Speaking URL
                path segment“

                tx_realurl_
                pathsegment



                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                             unternehmenskommunikation



                Debugging
                          page = PAGE
                          page.10 = HTML
                          page.10.value.debugData = 1
                          IP-Adresse in Install-Tool eintragen




                                                                   Inspiring people to
    TypoScript II: stdWrap für Anfänger                            share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                Debugging




                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                             unternehmenskommunikation



                Get data - data
                          Datentyp getText
                          Ermittlung
                          allgemeiner
                          Daten
                          Nicht auf
                          aktuelle Seite
                          beschränkt


                                                   Inspiring people to
    TypoScript II: stdWrap für Anfänger            share
Montag, 17. August 2009
typofaktum
                                                              unternehmenskommunikation



                Get data - data
                          page = PAGE
                          page.10 = HTML
                          page.10.value.data = date : d.m.Y
                          Gibt das aktuelle Datum aus
                          page = PAGE
                          page.10 = HTML
                          page.10.value.data = leveltitle : -2
                          Gibt den Seitentitel der Elternseite aus

                                                                    Inspiring people to
    TypoScript II: stdWrap für Anfänger                             share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          stdWrap Conditions /
                               Override

                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                   unternehmenskommunikation



                Conditions / Override
                          override            trim
                          preIfEmptyListNum   stdWrap
                          ifEmpty             required
                          ifBlank             if
                          listNum             fieldRequired


                                                         Inspiring people to
    TypoScript II: stdWrap für Anfänger                  share
Montag, 17. August 2009
typofaktum
                                                            unternehmenskommunikation



                Override / Conditions
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Der Untertitel ist leer!
                          page.10.value {
                            override.cObject = TEXT
                            override.cObject.field = subtitle
                          }
                          Gibt den Untertitel der Seite aus. Wenn dieser leer
                          ist, wird „Der Untertitel ist leer!“ ausgegeben

                                                                  Inspiring people to
    TypoScript II: stdWrap für Anfänger                           share
Montag, 17. August 2009
typofaktum
                                                          unternehmenskommunikation



                Override / Conditions
                          page = PAGE
                          page.10 = HTML
                          page.10 {
                            value = Diese Seite ist aktuell!
                            value.if {
                              value.data = date: U
                              isGreaterThan.field = newUntil
                            }
                          }


                                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger                         share
Montag, 17. August 2009
typofaktum
                                                        unternehmenskommunikation



                Override / Conditions
                          Gibt „Diese Seite ist aktuell!“ aus, wenn das
                          aktuelle Datum vor dem Datum liegt, welches im
                          Feld „New until“ in den Seiteneigenschaften
                          eingegeben wurde.




                                                              Inspiring people to
    TypoScript II: stdWrap für Anfänger                       share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



     Override /
     Conditions




                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation




                          stdWrap Parse Data


                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                                           unternehmenskommunikation



                Parse Data (Auswahl)
                          split (Aufsplitten nach Trennzeichen)
                          prioriCalc (Berechnen von Werten)
                          date (gibt ein formatiertes Datum zurück)
                          strftime (wie date)
                          removeBadHTML (filtert Sonderzeichen)
                          stripHtml (entfernt HTML)

                                                                  Inspiring people to
    TypoScript II: stdWrap für Anfänger                           share
Montag, 17. August 2009
typofaktum
                                                          unternehmenskommunikation



                Parse Data (Auswahl)
                          crop (Kürzen von Strings)
                          br (Wandelt Zeilenvorschübe in <br>-Tags um)
                          innerWrap (Wrappt den Inhalt)
                          wrap (Wrappt ebenfalls den Inhalt)
                          typolink (erzeugt einen Typolink)



                                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger                         share
Montag, 17. August 2009
typofaktum
                                                          unternehmenskommunikation



                Parse Data (Auswahl)
                          prepend (Stellt ein Content Objekt vor das aktuelle
                          Objekt)
                          append (Stellt ein Content Objekt hinter das
                          aktuelle Objekt)




                                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger                         share
Montag, 17. August 2009
typofaktum
                                                             unternehmenskommunikation



                Parse Data (dataWrap)
                          dataWrap
                          Der Inhalt wird nach geschweiften Klammern {}
                          durchsucht und dieser Teil wird laut Datentyp
                          getText (wie bei stdWrap „data“ ersetzt)
                          page = PAGE
                          page.10 = HTML
                          page.10.value.dataWrap = Die Seite heisst {page:title}


                                                                   Inspiring people to
    TypoScript II: stdWrap für Anfänger                            share
Montag, 17. August 2009
typofaktum
                                                              unternehmenskommunikation



                Parse Data (insertData)
                          insertWrap
                          Der Inhalt wird wie bei einem datWrap behandelt
                          page = PAGE
                          page.10 = HTML
                          page.10.value = Die ID der Seite ist: {TSFE:id}
                          page.10.value.insertData = 1




                                                                    Inspiring people to
    TypoScript II: stdWrap für Anfänger                             share
Montag, 17. August 2009
typofaktum
                                                                     unternehmenskommunikation



                Weitere Informationen:
                          TypoScript Reference TSref
                          http://www.tsref.de

                          TypoScript in 45 Minuten (DocTeam)
                          http://wiki.typo3.org/index.php/De:TSref/45MinutesTypoScript

                          Übersetzung der TSref
                          http://wiki.typo3.org/De:TSref

                          TypoScript Videotraining (video2brain)

                                                                           Inspiring people to
    TypoScript II: stdWrap für Anfänger                                    share
Montag, 17. August 2009
typofaktum
                                          unternehmenskommunikation



                Weitere Informationen:




                                                Inspiring people to
    TypoScript II: stdWrap für Anfänger         share
Montag, 17. August 2009
typofaktum
                                           unternehmenskommunikation




                          Vielen Dank!
                               Fragen???




                                                 Inspiring people to
    TypoScript II: stdWrap für Anfänger          share
Montag, 17. August 2009

Weitere ähnliche Inhalte

Mehr von die.agilen GmbH

LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)
LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)
LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)die.agilen GmbH
 
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...die.agilen GmbH
 
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...die.agilen GmbH
 
Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017
Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017
Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017die.agilen GmbH
 
Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...
Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...
Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...die.agilen GmbH
 
Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...
Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...
Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...die.agilen GmbH
 
Agile Mitarbeiterführung mit OKRs / Manage Agile 2017 / Berlin
Agile Mitarbeiterführung mit OKRs / Manage Agile 2017 / BerlinAgile Mitarbeiterführung mit OKRs / Manage Agile 2017 / Berlin
Agile Mitarbeiterführung mit OKRs / Manage Agile 2017 / Berlindie.agilen GmbH
 
The agile enterprise - Digital Transformation as a practical application
The agile enterprise - Digital Transformation as a practical applicationThe agile enterprise - Digital Transformation as a practical application
The agile enterprise - Digital Transformation as a practical applicationdie.agilen GmbH
 
How leadership of employees via Objectives and Key Results (OKR) speeds up th...
How leadership of employees via Objectives and Key Results (OKR) speeds up th...How leadership of employees via Objectives and Key Results (OKR) speeds up th...
How leadership of employees via Objectives and Key Results (OKR) speeds up th...die.agilen GmbH
 
4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...
4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...
4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...die.agilen GmbH
 
OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...
OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...
OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...die.agilen GmbH
 
30 Jahre Scrum - alles agil, alles gut? Auf dem Weg zum digitalen Unternehme...
30 Jahre Scrum - alles agil, alles gut?  Auf dem Weg zum digitalen Unternehme...30 Jahre Scrum - alles agil, alles gut?  Auf dem Weg zum digitalen Unternehme...
30 Jahre Scrum - alles agil, alles gut? Auf dem Weg zum digitalen Unternehme...die.agilen GmbH
 
Innovationsmotor Design Thinking - pluswerk
Innovationsmotor Design Thinking - pluswerkInnovationsmotor Design Thinking - pluswerk
Innovationsmotor Design Thinking - pluswerkdie.agilen GmbH
 
Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...
Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...
Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...die.agilen GmbH
 
TYPO3 CMS 8.1 - Die Neuerungen - pluswerk
TYPO3 CMS 8.1 - Die Neuerungen - pluswerkTYPO3 CMS 8.1 - Die Neuerungen - pluswerk
TYPO3 CMS 8.1 - Die Neuerungen - pluswerkdie.agilen GmbH
 
TYPO3 CMS 8.0 - Die Neuerungen - pluswerk
TYPO3 CMS 8.0 - Die Neuerungen - pluswerkTYPO3 CMS 8.0 - Die Neuerungen - pluswerk
TYPO3 CMS 8.0 - Die Neuerungen - pluswerkdie.agilen GmbH
 
TYPO3 CMS 7 LTS - Die Neuerungen - pluswerk
TYPO3 CMS 7 LTS - Die Neuerungen - pluswerkTYPO3 CMS 7 LTS - Die Neuerungen - pluswerk
TYPO3 CMS 7 LTS - Die Neuerungen - pluswerkdie.agilen GmbH
 
TYPO3 CMS 7.6 - Die Neuerungen - pluswerk
TYPO3 CMS 7.6 - Die Neuerungen - pluswerkTYPO3 CMS 7.6 - Die Neuerungen - pluswerk
TYPO3 CMS 7.6 - Die Neuerungen - pluswerkdie.agilen GmbH
 
WTC15 - Innovationsmotor Design Thinking
WTC15 - Innovationsmotor Design ThinkingWTC15 - Innovationsmotor Design Thinking
WTC15 - Innovationsmotor Design Thinkingdie.agilen GmbH
 
Medienhaus pecha-kucha - T3CON 2015
Medienhaus pecha-kucha - T3CON 2015Medienhaus pecha-kucha - T3CON 2015
Medienhaus pecha-kucha - T3CON 2015die.agilen GmbH
 

Mehr von die.agilen GmbH (20)

LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)
LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)
LEGO SERIOUS PLAY für Manager (Management 3.0 Gathering 2018)
 
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
 
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
Agiles Zielmanagement und modernes Leadership mit Objectives und Key Results ...
 
Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017
Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017
Innovationsmotoren Design Thinking, Lean Startup, Sprint & Co. - IT Tage 2017
 
Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...
Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...
Agile Leadership and Goal Management with Objectives & Key Results (OKRs) | A...
 
Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...
Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...
Die Entwicklung von Objectives und Key Results in Europa | 16.08.2017 | OKR F...
 
Agile Mitarbeiterführung mit OKRs / Manage Agile 2017 / Berlin
Agile Mitarbeiterführung mit OKRs / Manage Agile 2017 / BerlinAgile Mitarbeiterführung mit OKRs / Manage Agile 2017 / Berlin
Agile Mitarbeiterführung mit OKRs / Manage Agile 2017 / Berlin
 
The agile enterprise - Digital Transformation as a practical application
The agile enterprise - Digital Transformation as a practical applicationThe agile enterprise - Digital Transformation as a practical application
The agile enterprise - Digital Transformation as a practical application
 
How leadership of employees via Objectives and Key Results (OKR) speeds up th...
How leadership of employees via Objectives and Key Results (OKR) speeds up th...How leadership of employees via Objectives and Key Results (OKR) speeds up th...
How leadership of employees via Objectives and Key Results (OKR) speeds up th...
 
4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...
4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...
4DX - Die 4 Disziplinen der Umsetzung: Strategien sicher umsetzen und Ziele e...
 
OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...
OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...
OKR und BVB - Warum OKR der bessere Cristiano Ronaldo ist oder warum Scrum ni...
 
30 Jahre Scrum - alles agil, alles gut? Auf dem Weg zum digitalen Unternehme...
30 Jahre Scrum - alles agil, alles gut?  Auf dem Weg zum digitalen Unternehme...30 Jahre Scrum - alles agil, alles gut?  Auf dem Weg zum digitalen Unternehme...
30 Jahre Scrum - alles agil, alles gut? Auf dem Weg zum digitalen Unternehme...
 
Innovationsmotor Design Thinking - pluswerk
Innovationsmotor Design Thinking - pluswerkInnovationsmotor Design Thinking - pluswerk
Innovationsmotor Design Thinking - pluswerk
 
Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...
Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...
Atomic Design – Die Einheit von Frontend und Design im RWD-Zeitalter - webina...
 
TYPO3 CMS 8.1 - Die Neuerungen - pluswerk
TYPO3 CMS 8.1 - Die Neuerungen - pluswerkTYPO3 CMS 8.1 - Die Neuerungen - pluswerk
TYPO3 CMS 8.1 - Die Neuerungen - pluswerk
 
TYPO3 CMS 8.0 - Die Neuerungen - pluswerk
TYPO3 CMS 8.0 - Die Neuerungen - pluswerkTYPO3 CMS 8.0 - Die Neuerungen - pluswerk
TYPO3 CMS 8.0 - Die Neuerungen - pluswerk
 
TYPO3 CMS 7 LTS - Die Neuerungen - pluswerk
TYPO3 CMS 7 LTS - Die Neuerungen - pluswerkTYPO3 CMS 7 LTS - Die Neuerungen - pluswerk
TYPO3 CMS 7 LTS - Die Neuerungen - pluswerk
 
TYPO3 CMS 7.6 - Die Neuerungen - pluswerk
TYPO3 CMS 7.6 - Die Neuerungen - pluswerkTYPO3 CMS 7.6 - Die Neuerungen - pluswerk
TYPO3 CMS 7.6 - Die Neuerungen - pluswerk
 
WTC15 - Innovationsmotor Design Thinking
WTC15 - Innovationsmotor Design ThinkingWTC15 - Innovationsmotor Design Thinking
WTC15 - Innovationsmotor Design Thinking
 
Medienhaus pecha-kucha - T3CON 2015
Medienhaus pecha-kucha - T3CON 2015Medienhaus pecha-kucha - T3CON 2015
Medienhaus pecha-kucha - T3CON 2015
 

Typo Script für Anfänger II - stdWrap

  • 1. typofaktum unternehmenskommunikation stdWrap für Anfänger TypoScript - von Anfang an - Teil II 05. Mai 2009 - TYPO3 Usergroup München Patrick Lobacher Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 2. typofaktum unternehmenskommunikation Was kann TypoScript? Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 3. typofaktum unternehmenskommunikation „Normales“ TypoScript Setzen von Werten (Zuweisung) Kopieren und Referenzieren von Werten Ausklammern Conditions Objekte (TLO und Content-Objekte) Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 4. typofaktum unternehmenskommunikation „Normales“ TypoScript page = PAGE page { 10 = TEMPLATE 10 { template = FILE template.file = fileadmin/templates/index.html workOnSubpart = DOCUMENT marks { ... } } } Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 5. typofaktum unternehmenskommunikation Häufige Aufgaben Ermittlung von Daten (Datenbank, ...) Berechnen von Werten Formatieren von Werten Ausgabe von Werten, abhängig vom Ergebnis von Abfragen (if) Zerlegung von Texten => nicht machbar mit “normalem“ TypoScript Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 6. typofaktum unternehmenskommunikation Die Lösung: stdWrap Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 7. typofaktum unternehmenskommunikation Das Schweizer Messer des TypoScripts Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 8. typofaktum unternehmenskommunikation Was ist stdWrap?? Unklar woher der Name kommt - ausgesprochen „Standard Wrap“ Herkunft vom Wrap-Konzept: abc | def stdWrap ist ein Konzept, hinter dem zahlreiche nützliche (PHP)-Funktionen stehen, die Daten ermitteln, Daten überschreiben und Daten verarbeiten. Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 9. typofaktum unternehmenskommunikation ACHTUNG TECHNIK! Für stdWrap verantwortliche Datei in TYPO3: typo3/sysext/cms/tslib/class.tslib_content.php Alle möglichen Funktionen sind dort definiert Die dortige Reihenfolge ist entscheidend Momentan 76 Funktionen im stdWrap- Baukasten Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 10. typofaktum unternehmenskommunikation ACHTUNG TECHNIK! Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 11. typofaktum unternehmenskommunikation Referenz?? Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 12. typofaktum unternehmenskommunikation TSref www.tsref.net DIE Referenz Abschnitt 1.5 Functions stdWrap Abschnitt 1.2 Data types Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 13. typofaktum unternehmenskommunikation Auszug aus TSref Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 14. typofaktum unternehmenskommunikation TSref - Datentyp Mögliche Werte für eine TS-Eigenschaft Datentyp /stdWrap Erwartet einen Wert vom Typ „Datentyp“ (z.B. String, HTML, Integer, ...). Zusätzlich können DARAUF stdWrap- Funktionen angewendet werden. Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 15. typofaktum unternehmenskommunikation Einfache Beispiele Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 16. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 1 page = PAGE page.10 = HTML page.10.value = Hello Usergroup! Ausgabe: Hello Usergroup! Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 17. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 2 page = PAGE page.10 = HTML page.10.value = Hello Usergroup! page.10.value.case = upper Ausgabe: HELLO USERGROUP! Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 18. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 3 page = PAGE page.10 = HTML page.10.value = Hello Usergroup! page.10.value.wrap = Welcome! | Ciao! Ausgabe: Welcome!Hello Usergroup!Ciao! Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 19. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 4 page = PAGE page.10 = HTML page.10.value = Hello Usergroup! page.10.value.crop = 5 | ... Ausgabe: Hello... Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 20. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 4 Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 21. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 4 page = PAGE page.10 = HTML page.10.value = Munich page.10.value.wrap = Hello | Usergroup page.10.value.crop = 5 | ... Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 22. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 4 page = PAGE page.10 = HTML page.10.value = Munich page.10.value.wrap = Hello | Usergroup page.10.value.crop = 5 | ... Ausgabe: Hello... Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 23. typofaktum unternehmenskommunikation Einfaches HTML-Objekt - 4 page = PAGE page.10 = HTML page.10.value = Munich page.10.value.wrap = Hello | Usergroup page.10.value.crop = 5 | ... Ausgabe: Hello... HelloMunic...Usergroup ✔ Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 24. typofaktum unternehmenskommunikation stdWrap Systematik Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 25. typofaktum unternehmenskommunikation stdWrap - Arten Get data - Daten ermitteln (field, data, ...) Override / Conditions - Überschreiben und IF (override, if, required, stdWrap,...) Parse data (Parsen und Verändern) (split, prioriCalc, case, crop, wrap, ...) Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 26. typofaktum unternehmenskommunikation stdWrap Get Data Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 27. typofaktum unternehmenskommunikation Get data setContentToCurrent current setCurrent cObject lang numRows data filelist field preUserFunc Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 28. typofaktum unternehmenskommunikation Get data - field Ermittelt den Wert eines Datenbankfeldes aus dem aktuellen Context Context beim PAGE-Objekt ist die Tabelle pages In dem Fall können sämtliche Elemente der Seiteneigenschaften ermittelt werden Wenn nichts anderes angegeben wurde, werden die Daten der aktuellen Seite ermittelt Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 29. typofaktum unternehmenskommunikation Get data - field page = PAGE page.10 = HTML page.10.value.field = title Gibt den Seitentitel der aktuellen Seite aus Problem: Wie heissen die anderen Felder? Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 30. typofaktum unternehmenskommunikation Get data - field Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 31. typofaktum unternehmenskommunikation Firebug Ermittlung des Feldes „Speaking URL path segment“ tx_realurl_ pathsegment Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 32. typofaktum unternehmenskommunikation Debugging page = PAGE page.10 = HTML page.10.value.debugData = 1 IP-Adresse in Install-Tool eintragen Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 33. typofaktum unternehmenskommunikation Debugging Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 34. typofaktum unternehmenskommunikation Get data - data Datentyp getText Ermittlung allgemeiner Daten Nicht auf aktuelle Seite beschränkt Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 35. typofaktum unternehmenskommunikation Get data - data page = PAGE page.10 = HTML page.10.value.data = date : d.m.Y Gibt das aktuelle Datum aus page = PAGE page.10 = HTML page.10.value.data = leveltitle : -2 Gibt den Seitentitel der Elternseite aus Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 36. typofaktum unternehmenskommunikation stdWrap Conditions / Override Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 37. typofaktum unternehmenskommunikation Conditions / Override override trim preIfEmptyListNum stdWrap ifEmpty required ifBlank if listNum fieldRequired Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 38. typofaktum unternehmenskommunikation Override / Conditions page = PAGE page.10 = HTML page.10.value = Der Untertitel ist leer! page.10.value { override.cObject = TEXT override.cObject.field = subtitle } Gibt den Untertitel der Seite aus. Wenn dieser leer ist, wird „Der Untertitel ist leer!“ ausgegeben Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 39. typofaktum unternehmenskommunikation Override / Conditions page = PAGE page.10 = HTML page.10 { value = Diese Seite ist aktuell! value.if { value.data = date: U isGreaterThan.field = newUntil } } Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 40. typofaktum unternehmenskommunikation Override / Conditions Gibt „Diese Seite ist aktuell!“ aus, wenn das aktuelle Datum vor dem Datum liegt, welches im Feld „New until“ in den Seiteneigenschaften eingegeben wurde. Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 41. typofaktum unternehmenskommunikation Override / Conditions Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 42. typofaktum unternehmenskommunikation stdWrap Parse Data Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 43. typofaktum unternehmenskommunikation Parse Data (Auswahl) split (Aufsplitten nach Trennzeichen) prioriCalc (Berechnen von Werten) date (gibt ein formatiertes Datum zurück) strftime (wie date) removeBadHTML (filtert Sonderzeichen) stripHtml (entfernt HTML) Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 44. typofaktum unternehmenskommunikation Parse Data (Auswahl) crop (Kürzen von Strings) br (Wandelt Zeilenvorschübe in <br>-Tags um) innerWrap (Wrappt den Inhalt) wrap (Wrappt ebenfalls den Inhalt) typolink (erzeugt einen Typolink) Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 45. typofaktum unternehmenskommunikation Parse Data (Auswahl) prepend (Stellt ein Content Objekt vor das aktuelle Objekt) append (Stellt ein Content Objekt hinter das aktuelle Objekt) Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 46. typofaktum unternehmenskommunikation Parse Data (dataWrap) dataWrap Der Inhalt wird nach geschweiften Klammern {} durchsucht und dieser Teil wird laut Datentyp getText (wie bei stdWrap „data“ ersetzt) page = PAGE page.10 = HTML page.10.value.dataWrap = Die Seite heisst {page:title} Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 47. typofaktum unternehmenskommunikation Parse Data (insertData) insertWrap Der Inhalt wird wie bei einem datWrap behandelt page = PAGE page.10 = HTML page.10.value = Die ID der Seite ist: {TSFE:id} page.10.value.insertData = 1 Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 48. typofaktum unternehmenskommunikation Weitere Informationen: TypoScript Reference TSref http://www.tsref.de TypoScript in 45 Minuten (DocTeam) http://wiki.typo3.org/index.php/De:TSref/45MinutesTypoScript Übersetzung der TSref http://wiki.typo3.org/De:TSref TypoScript Videotraining (video2brain) Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 49. typofaktum unternehmenskommunikation Weitere Informationen: Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009
  • 50. typofaktum unternehmenskommunikation Vielen Dank! Fragen??? Inspiring people to TypoScript II: stdWrap für Anfänger share Montag, 17. August 2009