2014-04-26
TYPO3 Neos 1.0.2 The Compendium
translated into english
LOBACHER . Patrick Lobacher Roland Schenke Head of Web Development TYPO3 Neos - the Compendium Feedback LOBACHER.
Feedback requested ! • Dear Neos Enthusiast!
I try to keep the TYPO3 Neos Compendium on an up-to-date Level. To achieve this I need your Input! If you have ideas regarding Code Examples, FAQ Entries or just want to praise or criticize please do not hesitate to contact me at the following address:
patrick [AT] lobacher.de
Have fun with the Compendium! Patrick Lobacher & Roland Schenke
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 2 TYPO3 Neos - the Compendium Changelog LOBACHER.
Changelog Date Changes 2013-08-08 Initial Version / Thanks to Christian Schwerdt for domainFACTORY specific Input
2013-08-09 included proof corrections by Roland Schenke and Michael Oehlhof - Thanks!
2013-08-10 added Nginx-Config - Thanks to Christian Kuhn, Christian Müller and Anja Leichsenring
2013-08-10 added Troubleshoot Section
2013-08-18 included proof corrections by Roland Schenke - Thanks!
2013-08-18 translated from german into english by Roland Schenke - Thanks a lot!
2013-12-12 updated to TYPO3 Neos 1.0 final
2013-12-15 updated to TYPO3 Neos 1.0.1
2014-01-07 Link for the installation under Shared Hosting and proof corrections (Thanks to Christian Glass!)
2014-03-03 migrated to „LOBACHER.“ CI
2014-03-05 updated to TYPO3 Neos 1.0.2
2014-03-07 added installation on a all-inkl.com Server. Thanks to Mario Janetzko!
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 3 TYPO3 Neos - the Compendium Changelog LOBACHER.
Changelog Date Changes 2014-04-26 He did it again! Many thanks to Roland Schenke for updating the english translation to Neos 1.0.2!!!
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 4 LOBACHER.
What is TYPO3 Neos?
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 5 TYPO3 Neos - the Compendium TYPO3 Neos - the next generation CMS LOBACHER.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 6 TYPO3 Neos - the Compendium TYPO3 Neos - the next generation CMS LOBACHER.
http://neos.typo3.org/download/marketing-material.html
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 7 TYPO3 Neos - the Compendium TYPO3 Neos - the next generation CMS LOBACHER.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 8 TYPO3 Neos - the Compendium TYPO3 Neos - the next generation CMS LOBACHER.
Neos (greek νέος) is just “new”
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 9 TYPO3 Neos - the Compendium The History of TYPO3 Neos starts with TYPO3 CMS LOBACHER.
The History of TYPO3 Neos starts with TYPO3 CMS ! • TYPO3 CMS is a „Enterprise Open Source Content Management Framework“ • TYPO3 CMS exists since 1998 / invented by the Dane Kaspar Skårhøj • approx. 500.000 Installations worldwide / > 5 Mio Downloads • Usage in DE e.g. at > 50% all DAX 500 Enterprises, > 50% all „German Soccer League“ Clubs, discounter, car rentals, public agencies • > 6.000 Extensions • > 100.000 Developers worldwide • > 1500 Agencies worldwide • funded and backed by the TYPO3 Association
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 10 TYPO3 Neos - the Compendium The History of TYPO3 Neos: TYPO3 Phoenix LOBACHER.
The History of TYPO3 Neos: TYPO3 Phoenix ! • At the very first T3DD (TYPO3 Developer Days) in 2006, the decision was made to rewrite TYPO3 from scratch. • Codename: TYPO3 Phoenix (resp. TYPO3 5.0) • some necessary PHP Features were not available at this time and had to be implemented from the ground up: Content Respository, Aspect Oriented Programming, Dependency Injection, ... • The "Berlin Manifesto" of 2008 states the differentiation to the TYPO3 CMS http://typo3.org/roadmap/berlin-manifesto/ (In the meantime Parts of the manifesto became obsolete.)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 11 TYPO3 Neos - the Compendium The History of TYPO3 Neos: TYPO3 Flow and Ne0s LOBACHER.
The History of TYPO3 Neos: TYPO3 Flow and Ne0s
• Many base functionalities of a CMS are not specific to a CMS (Session- Handling, Datenbank-Handling, Templating, ...) => therefore outsourcing into an own Framework TYPO3 Flow • The introduction of Extbase in 2009 made it possible to write TYPO3 CMS extensions which are executable in TYPO3 Flow with minor adjustments • On 20 October 2011 the Application Framework TYPO3 Flow (once FLOW3) has been released as Final • TYPO3 Neos ist an Application based on TYPO3 Flow • TYPO3 Neos Alpha 7 in October 2013 / Beta 1 on Nov. 12, 2013 • First final Version on 10 December 2013
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 12 TYPO3 Neos - the Compendium The History of TYPO3 Neos: TYPO3 Flow and Ne0s LOBACHER.
Version History TYPO3 Neos
Version Datum TYPO3 Phoenix Sprint Release 1 2010-05-31 ...... TYPO3 Phoenix Sprint Release 9 2012-08-02 TYPO3 Neos alpha 1 2012-10-05 TYPO3 Neos alpha 2 2012-12-19 TYPO3 Neos alpha 3 2012-02-16 TYPO3 Neos alpha 4 2013-07-07 TYPO3 Neos alpha 5 2013-08-07 TYPO3 Neos alpha 6 2013-10-15 TYPO3 Neos alpha 7 2013-10-30 TYPO3 Neos beta 1 2013-11-12 TYPO3 Neos beta 2 2013-12-03 TYPO3 Neos 1.0 final 2013-12-10 TYPO3 Neos 1.0.1 2013-12-13
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 13 TYPO3 Neos - the Compendium The History of TYPO3 Neos: Die TYPO3 World LOBACHER.
The TYPO3 World - since October 2012
• Umbrella Brand TYPO3
• TYPO3 CMS (no distinct Logo) • TYPO3 Flow • TYPO3 Neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 14 TYPO3 Neos - the Compendium The History of TYPO3 Neos: Die TYPO3 World LOBACHER.
TYPO3 Neos: Positioning
• Since December 2013 two independent CMS are offered by TYPO3: • TYPO3 CMS 6.x (4.7, 6.0, 6.1, 6.2 LTS Beta) • TYPO3 Neos 1.0 • from a technology point of view they share NOTHING but the name and are as different as different can be • There are NO migration paths from one system to the other • TYPO3 Neos is NOT the successor of TYPO3 CMS, but a self-contained CMS with a different focus
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 15 LOBACHER.
The Architecture of TYPO3 Neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 16 TYPO3 Neos - the Compendium The Architecture of TYPO3 Neos - Backend LOBACHER.
The Architecture of TYPO3 Neos - Backend Fluid Modern Templating Engine ! TYPO3CR Content Repository ( JCR / Sling)
TypoScript TypoScript 2.0 - next Generation
Forms Form API & Form Builder
Expose Extensible admin interface
Eel Embedded Expression Language
FlowQuery
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 17 TYPO3 Neos - the Compendium The Architecture of TYPO3 Neos - Frontend LOBACHER.
The Architecture of TYPO3 Neos - Frontend
! EmberJS JavaScript Web Application Framework
Create.js Web Editing Interface
Aloha / Hallo HTML5 WYSIWYG Editor
VIE = viejs.org Semantic Interaction Framework
RequireJS JavaScript file and module loader
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 18 LOBACHER.
Installation of TYPO3 Neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 19 TYPO3 Neos - the Compendium Requirements of TYPO3 Neos LOBACHER.
Requirements of TYPO3 Neos ! • Webserver (recommended: Apache 2.x with activated mod_rewrite Module) • PHP 5.3.7 - 5.4.x (the bare minimum PHP 5.3.2 might cause problems) • following funktions must be activated and allowed in PHP: system(), shell_exec(), escapeshellcmd() und escapeshellarg() • php.ini: memory_limit = 256M or higher • php.ini: xdebug.max_nesting_level = 500 (in case xdebug is used) • php.ini: add the following Options to the end of the file: detect_unicode = Off • php.ini: additionally Magic_Quotes must be deactivated: magic_quotes_gpc = Off • php.ini: the command line of Flow requires a timezone definition: date.timezone= "Europe/Berlin" (or applicable)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 20 TYPO3 Neos - the Compendium Requirements of TYPO3 Neos LOBACHER.
Requirements of TYPO3 Neos ! • It is important that the CLI Version of PHP is at least version 5.3.7 as well (and has the appropriate and mentioned settings) - one can check the version with the following command
php --version
• MySQL 5.1.50 - 5.x.x (as an example - basically every Doctrine DBAL compatible database can be used)
• root access to the commandline / shell
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 21 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Directory Structure LOBACHER.
Directory Structure
• Directory structure where the installation is meant to occur.
/path/to/Webserver |-TYPO3-Neos |---Build |---... |---Web (Document Root)
• All Neos-Files are in the directory TYPO3-Neos (this will be added by „Composer“ in the next steps.) • There will be no distinction between Core and UserSpace (like TYPO3 CMS) • The Document Root is to be mapped to /path/to/Webserver/TYPO3- Neos/Web
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 22 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Composer LOBACHER.
Installation of TYPO3 Neos - Composer
• Installation is done via „Composer“ (Dependency Manager for PHP) - that‘s the shell access for
cd /pfad/zum/webserver/
curl -sS https://getcomposer.org/installer | php
• This creates the composer.phar file in the current directory • If one would like to use Composer system wide, it can be copied or moved (this will be assumed in the following) mv composer.phar /usr/local/bin/composer
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 23 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Composer LOBACHER.
Installation of TYPO3 Neos - Composer
• Download TYPO3 Neos via Composer (one single line!):
php /path/to/composer.phar create-project typo3/neos-base-distribution TYPO3-Neos
• This takes care of the Installation of TYPO3 Flow, Neos and necessary Modules (incl. 3rd Party like Doctrine 2, Aloha, ...) • Afterwards one gets directory named TYPO3-Neos, which holds the latest version of Neos • The installation of Composer under Windows is covered here: http://getcomposer.org/doc/00-intro.md#installation-windows
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 24 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - use archives LOBACHER.
[Alternative:] use archives
• the latest version is offered to download on sourceforge as zip, tar.gz and tar.bz2:
http://sourceforge.net/projects/typo3flow/files/ TYPO3%20Neos/1.0.1/ •
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 25 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - GIT Version LOBACHER.
[Alternative:] use git version of TYPO3 Neos
• cloning the latest version of TYPO3 Neos via git:
git clone git://git.typo3.org/Neos/Distributions/ Base.git TYPO3-Neos && cd TYPO3-Neos
subsequently these dependencies have to be loaded:
composer install --dev
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 26 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - rights & VirtualHost LOBACHER.
Installation of TYPO3 Neos - rights & VirtualHost
• This console command sets the filesystem rights: cd TYPO3-Neos sudo ./flow flow:core:setfilepermissions shelluser wwwuser wwwgroup
(additional Info: http://docs.typo3.org/flow/TYPO3FlowDocumentation/ TheDefinitiveGuide/PartII/Installation.html#file-permissions)
• shelluser That is the User you‘re logged in on the shell with - can be found out with whoami
• wwwuser The group the Webserver Process runs with (see file httpd.conf) - under Mac OS X e.g. _www
• wwwgroup The group the Webserver Process runs with (see file httpd.conf) - under Mac OS X e.g. _www
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 27 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - VirtualHost LOBACHER.
Installation of TYPO3 Neos - VirtualHost
• Virtual Host Entry (e.g. Apache) NameVirtualHost *:80 # if needed
DocumentRoot "/path/to/webserver/TYPO3-Neos/Web/"
# during development this line should be kept # commented out, because this changes the Context to # „Production“ - meaning: no Logging, with Caching, ... Setenv FLOW_CONTEXT Production ServerName neos.demo
• Entry in /etc/hosts (e.g.: C:\windows\system32\drivers\etc\hosts) 127.0.0.1 neos.demo
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 28 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Setup LOBACHER.
Installation of TYPO3 Neos - Setup
• Call the Setup routine http://neos.demo/setup/
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 29 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Setup LOBACHER.
Installation of TYPO3 Neos - Setup
• The Password is located in the file at the path shown below. (remember!) /path/to/webserver/TYPO3-Neos/Data/SetupPassword.txt
The file containing the password is deleted afterwards. In case of Oblivion, i.e. it is forgotten, the file
/path/to/webserver/TYPO3- Neos/Data/Persistent/ FileBasedSimpleKeyService /SetupKey
is to be deleted and setup called again.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 30 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Setup LOBACHER.
Installation of TYPO3 Neos - Setup ! • setup of the database • MySQL is preset • the driver can be changed by adjusting the file: Configuration/Settings.yaml • If 127.0.0.1 as „DB Host“ does not work, try to enter localhost instead. • you can choose between using an existing database or create a new one
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 31 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Setup LOBACHER.
Installation of TYPO3 Neos - Setup ! • create an administrator account
• User Management provides the possibility for the creation of subsequent user
• that includes adding additional user data
• creation is also possible via console:
./flow typo3.neos:user:create username password firstname lastname
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 32 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Setup LOBACHER.
Installation of TYPO3 Neos - Setup ! • one can import a demo site (recommended)
• or start with a blank website
• as soon as something is entered into the form fields, a new site is created
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 33 TYPO3 Neos - the Compendium Installation of TYPO3 Neos - Setup LOBACHER.
Installation of TYPO3 Neos - Setup ! • Once the installation cycle succeeded, the corresponding advice appears
• You will find the documentation at
http://docs.typo3.org/neos/
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 34 TYPO3 Neos - the Compendium Installation of TYPO3 Neos LOBACHER.
Installation of TYPO3 Neos - Setup
The Frontend looks like the left- handed image, if the Demo-Site TYPO3.NeosDemoTypo3Org is imported ! If an empty site has been created, the following screen is shown
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 35 TYPO3 Neos - the Compendium Installation of TYPO3 Neos LOBACHER.
Installation of TYPO3 Neos - Setup ! Access to the Installation: ! • Frontend http://neos.demo/ ! • Backend http://neos.demo/neos/ ! • Setup http://neos.demo/setup/
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 36 LOBACHER.
Installation on a domainFACTORY Server
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 37 TYPO3 Neos - the Compendium Installation on a domainFACTORY Server LOBACHER.
Installation on a domainFACTORY Server ! domainFACTORY Server require a slightly modified Installation ! • Credits to: Christian Schwerdt (die Medienagenten oHG) ! • An english manual can also be found here:
https://github.com/cschwerdt/TYPO3-NEOS-Install
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 38 TYPO3 Neos - the Compendium Installation on a domainFACTORY Server LOBACHER.
Installation on a domainFACTORY Server ! • load Composer curl -s https://getcomposer.org/installer | /usr/local/bin/php5-53STABLE-CLI ! • load TYPO3 Neos 1.0: /usr/local/bin/php5-53LATEST-CLI composer.phar create-project --dev -- stability alpha typo3/neos-base-distribution TYPO3-Neos-1.0.0
• Inside the domainFACTORY-Settings the Domain has to be configured to point to the /Web directory.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 39 TYPO3 Neos - the Compendium Installation on a domainFACTORY Server LOBACHER.
Installation on a domainFACTORY Server ! • change the PHP-Path inside the Flow-CLI cd TYPO3-Neos-1.0 vi flow
The first line has to be changed from
#!/usr/bin/env php
to the following:
#!/usr/local/bin/php5-53STABLE-CLI
Save with
:!wq
or choose any plain text editor you‘re familiar with
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 40 TYPO3 Neos - the Compendium Installation on a domainFACTORY Server LOBACHER.
Installation on a domainFACTORY Server ! • adjusting Settings.yaml in Configuration/ cd Configuration/ cp Settings.yaml.example Settings.yaml vi Settings.yaml
//set database host db: 'mysql5.
//uncomment core: & phpBinaryPathAndFilename //and change phpBinaryPathAndFilename to: core: phpBinaryPathAndFilename: '/usr/local/bin/php5-53STABLE-CLI'
save with:
:wq! !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 41 TYPO3 Neos - the Compendium Installation on a domainFACTORY Server LOBACHER.
Installation on a domainFACTORY Server ! • adjusting Settings.yaml in Development cd Development/ cp Settings.yaml.example Settings.yaml vi Settings.yaml
//set dbname, dbuser, dbpassword: dbname: '
save with:
:wq! !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 42 TYPO3 Neos - the Compendium Installation on a domainFACTORY Server LOBACHER.
Installation on a domainFACTORY Server ! • Flow Help ./flow help
• migrate Database ./flow doctrine:migrate
• kickstart a Site Syntax: ./flow site:kickstart [PackageKey] [SiteName] ./flow site:kickstart Your.Demopage Your.Demopage
• list Sites ./flow site:list ! !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 43 TYPO3 Neos - the Compendium Installation on a domainFACTORY Server LOBACHER.
Installation on a domainFACTORY Server ! • add Neos Backend User ./flow user:create
• add Admin Userrole ./flow user:addrole
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 44 LOBACHER.
Installation on a all-inkl.com Server
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 45 TYPO3 Neos - the Compendium Installation on a all-inkl.com Server LOBACHER.
Installation on a all-inkl.com Server ! On the servers of „ALL-INKL.COM - Neue Medien Münnich“ you have to follow a slightly different installation instruction.
• Credits to: Mario Janetzko (die Medienagenten oHG)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 46 TYPO3 Neos - the Compendium Installation on a all-inkl.com Server LOBACHER.
Installation on a all-inkl.com Server ! • Prior to installation the following steps have to executed ! • open the file Bootstrap.php at /Packages/Framework/ TYPO3.Flow/Classes/TYPO3/Flow/Core/
• add the following after namespace TYPO3\Flow\Core;
ini_set('date.timezone','Europe/Berlin'); ini_set('memory_limit','256M');
…
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 47 TYPO3 Neos - the Compendium Installation on a all-inkl.com Server LOBACHER.
Installation on a all-inkl.com Server ! • comment out the lines 557 - 560 in the file Bootstrap.php
OLD:
if (version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc() === 1) { echo('Flow requires the PHP setting "magic_quotes_gpc" set to Off. (Error #1224003190)’); exit(1); }
NEW:
/* if (version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc() === 1) { echo('Flow requires the PHP setting "magic_quotes_gpc" set to Off. (Error #1224003190)’); exit(1); } */
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 48 TYPO3 Neos - the Compendium Installation on a all-inkl.com Server LOBACHER.
Installation on a all-inkl.com Server ! • add the following lines to the file Web/index.php starting at line 23:
… require($rootPath . 'Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/ Bootstrap.php');
putenv ("FLOW_REWRITEURLS=1"); putenv ("FLOW_CONTEXT=Production"); if (substr($_SERVER['HTTP_HOST'],0,4) === 'dev.') { putenv ("FLOW_CONTEXT=Development"); }
$context = getenv('FLOW_CONTEXT') ?: (getenv('REDIRECT_FLOW_CONTEXT') ?: 'Development'); …
• The installation can be started now!
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 49 LOBACHER.
Troubleshoot FAQ / Help
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 50 TYPO3 Neos - the Compendium Troubleshoot / FAQ / Help LOBACHER.
alternative methods of Installation and Support please note: some of the links might be in german! • TYPO3 Neos Vagrant Box https://github.com/tlayh/vagrant-typo3neos • TYPO3 Neos Installation on Mac OS X Snow Leopard and MAMP http://www.content-driven-ecommerce.de/typo3-neos-install/ • .git ignore File https://git.typo3.org/Neos/Distributions/Base.git/blob/ HEAD:/.gitignore • Launchr (test TYPO3 Neos online) https://launchr.com/ • Mittwald Hosting - 30 days trial TYPO3 Neos Account https://www.mittwald.de/neos-testen/ • Manual Installation by jweiland.net http://jweiland.net/typo3/neos/neos-installation/manuelle-neos- installation.html
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 51 TYPO3 Neos - the Compendium Troubleshoot / FAQ / Help LOBACHER.
problems that may arise during installation • In the PHP log or on the console while issuing ./flow help or on the frontend an error message which is similar to the following appears: • ...'"typo3eel" is not a valid package key... Workaround: use a patched Composer file: http://downloads.sourceforge.net/project/typo3flow/patched-1147-composer.phar
• There is an error message which is similar to the following: ...Class 'PHPUnit_Framework_Constraint' not found in... oder ...imagine... (something refers / hints to imagine) Solution: Deletion of the PackageStates file rm Configuration/PackageStates.php
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 52 LOBACHER.
Nginx Config for TYPO3 Neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 53 TYPO3 Neos - the Compendium Nginx Config for TYPO3 Neos LOBACHER.
Nginx Config for TYPO3 Neos ! • Credits to: • Christian Kuhn • Christian Müller • Anja Leichsenring
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 54 TYPO3 Neos - the Compendium Nginx Config for TYPO3 Neos LOBACHER.
Nginx Config for TYPO3 Neos ! • File /etc/nginx/sites-available/neos.demo (Domain assumed neos.demo) # Upstream to abstract backend connection(s) for php upstream neos.demo { server unix:/var/run/neos.demo_fpm.sock; } server { server_name neos.demo; root /path/to/webserver/TYPO3-Neos/Web; i n d e x i n d e x . p h p ; error_log /path/to/webserver/TYPO3-Neos/logs/error_log; access_log /path/to/webserver/TYPO3-Neos/logs/access_log; ## Disable .htaccess and other hidden files l o c a t i o n ~ / \ . { d e n y a l l ; a c c e s s _ l o g o f f ; l o g _ n o t _ f o u n d o f f ; } location = /favicon.ico { l o g _ n o t _ f o u n d o f f ; a c c e s s _ l o g o f f ; } location = /robots.txt { a l l o w a l l ; l o g _ n o t _ f o u n d o f f ; a c c e s s _ l o g o f f ; }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 55 TYPO3 Neos - the Compendium Nginx Config for TYPO3 Neos LOBACHER.
Nginx Config for TYPO3 Neos ! • File /etc/nginx/sites-available/neos.demo (...continued...) location /_Resources/ { a c c e s s _ l o g o f f ; l o g _ n o t _ f o u n d o f f ; e x p i r e s m a x ; b r e a k ; } location /_Resources/Persistent/ { a c c e s s _ l o g o f f ; l o g _ n o t _ f o u n d o f f ; e x p i r e s m a x ; rewrite "(.{40})/.+\.(.+)" /_Resources/Persistent/$1.$2 break; rewrite "([a-z0-9]+/(.+/)?[a-f0-9]{40})/.+\.(.+)" /_Resources/Persistent/$1.$2 break; } # # # # stop rewriting by existing files | is instead of -> location / { rewrite ".*" /index.php last; } # use this if you want to run other PHP-Applications in TYPO3-Flow/Web directory # # # try_files $uri $uri/ /index.php?$args;
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 56 TYPO3 Neos - the Compendium Nginx Config for TYPO3 Neos LOBACHER.
Nginx Config for TYPO3 Neos ! • File /etc/nginx/sites-available/neos.demo (...last part...) location ~ \.php$ { fastcgi_index index.php; # # # # for FLOW3 <= 1.1.x only | see note #15 on http://forge.typo3.org/issues/8923 # # # # fastcgi_param FLOW3_CONTEXT Development; # fastcgi_param FLOW3_CONTEXT Production; # fastcgi_param FLOW3_REWRITEURLS 1; # # # # Make sure that you set the environment vars for new versions \ # of TYPO3-XXXXX(TYPO3-Neos) products properly # see note #15 on http://forge.typo3.org/issues/8923 ### fastcgi_param FLOW_CONTEXT Development; fastcgi_param FLOW_REWRITEURLS 1; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass neos.domain.tld; include /etc/nginx/fastcgi_params; } }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 57 TYPO3 Neos - the Compendium Nginx Config for TYPO3 Neos LOBACHER.
Nginx Config for TYPO3 Neos ! • File /etc/php5/fpm/pool.d/neos.demo.pool.conf
[neos.demo] listen = /var/run/neos.demo.sock listen.owner = neos.demo listen.group = demo listen.mode = 0660 user = neos.demo group = demo pm = dynamic pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 3 pm.max_spare_servers = 10 pm.max_requests = 200 request_terminate_timeout = 360s chdir = / php_admin_value[session.save_path] = "/path/to/webserver/TYPO3-Neos/sessions" # During installation this might not be sufficient, cleaned it up afterwards. # Neos mentions it, add it, restart php-fpm, go on. Sufficient for operation. php_admin_value[open_basedir] = "/path/to/webserver/TYPO3-Neos/:/usr/share/pear:/usr/share/php:/tmp:/usr/local/ lib/php:/usr/bin/php"
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 58 TYPO3 Neos - the Compendium Nginx Config for TYPO3 Neos LOBACHER.
Nginx Config for TYPO3 Neos ! • File Configuration/Settings.yaml
TYPO3: Flow: persistence: backendOptions: dbname: ... user: ... password: ... host: 127.0.0.1 core: ! subRequestPhpIniPathAndFilename: /etc/php5/cli/php.ini
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 59 LOBACHER.
Upgrade of TYPO3 Neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 60 TYPO3 Neos - the Compendium Upgrade von TYPO3 Neos LOBACHER.
Upgrade von TYPO3 Neos ! lifting an existing 1.0 installation to the latest patch level can be achieved as follows: cd /pfad/zum/webserver/ composer update --no-dev "typo3/*" # flush Cache! ./flow flow:cache:flush --force ./flow doctrine:migrate
If necessary php composer.phar has to be used!
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 61 TYPO3 Neos - the Compendium Upgrade of TYPO3 Neos LOBACHER.
Upgrade of TYPO3 Neos ! If there is an existing Neos, it can be updated to a given version quite comfortable using Composer: ! cd /path/to/webserver/ composer require "typo3/neos:1.0.*" composer require "typo3/neos-nodetypes:1.0.*" composer require "typo3/neosdemotypo3org:1.0.*" composer require "typo3/neos-kickstarter:1.0.*" # flush Cache! ./flow flow:cache:flush --force ./flow doctrine:migrate
If necessary php composer.phar has to be used!
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 62 TYPO3 Neos - the Compendium Usage of Development Master LOBACHER.
Usage of Development Master ! If by all means one would like to use the latest (trunk in git lingo) TYPO3 Neos, one can switch to the Development Master cd /path/to/webserver/ composer update update database: ./flow doctrine:migrate
flush cache: ./flow flow:cache:flush --force
If necessary php composer.phar has to be used!
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 63 LOBACHER.
Virtual Machines
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 64 TYPO3 Neos - the Compendium Virtual Machines LOBACHER.
Virtual Machines ! A few projects are offering virtual machines for TYPO3 Neos (and Flow):
• Vagrant (TYPO3 Neos / Flow oder CMS has to be installed yourself) https://github.com/swiftlizard/VagrantTYPO3
• Vagrant (TYPO3 Neos / Flow oder CMS has to be installed yourself) https://github.com/mrimann/VagrantTYPO3Flow
• fully working TYPO3 Neos https://launchr.com/typo3-neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 65 LOBACHER.
Release Notes
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 66 TYPO3 Neos - the Compendium Release Notes LOBACHER.
Release Notes TYPO3 Neos 1.0.1 (2013-12-13) ! • [TASK] Update references in documentation • [BUGFIX] Handle inline loading of pages without metadata correctly • [BUGFIX] Use FQ TypoScript paths for lastVisitedNode functionality • [BUGFIX] Add a safeguard to the LIBXML_PARSEHUGE constant • [BUGFIX] Fix wrong type annotation that causes compilation problems • [BUGFIX] Fix built-in Menu TypoScript object template • [BUGFIX] Protypes don't use FQN • [BUGFIX] Correctly link the Neos logo with the NodeViewHelper ! • https://git.typo3.org/Packages/TYPO3.Neos.git/blob_plain/ e87653620afa44112fc8b32414c9d90d464b3b00:/Documentation/Appendixes/ ChangeLogs/101.rst
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 67 TYPO3 Neos - the Compendium Release Notes LOBACHER.
Release Notes TYPO3 Neos 1.0.2 (2014-03-04) - Part 1
TYPO3.Neos • [TASK] Update references in documentation • [BUGFIX] Secondary inspector is rendered outside viewport in FF • [BUGFIX] A better way of parsing the HTML of asynchronous page loads • [TASK] Optimize typical filter usages of EEL children operation • [BUGFIX] Default attributes property of menu TypoScript object • [BUGFIX] "node" used in label for create new dialog • [BUGFIX] Security policies in Neos are too strict • [BUGFIX] Link inceptor handling of local links • [BUGFIX] Node tree filter too wide in Firefox • [BUGFIX] Sites management module widget action button • [TASK] Improve usability of position menus in navigate component • [BUGFIX] Title missing for paste/new buttons in navigate component • [BUGFIX] Shortcut to siteroot has no active state • [TASK] Fix minor errors in documentation • [!!!][BUGFIX] Only accepts URLs with the configured URI suffix • [BUGFIX] YAML indention and typo in integrators cookbook • [TASK] Fix various CGL violations • [BUGFIX] Opacity of datetime editor inspector field • [TASK] Add missing grunt-trimtrailingspaces dependency
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 68 TYPO3 Neos - the Compendium Release Notes LOBACHER.
Release Notes TYPO3 Neos 1.0.2 (2014-03-04) - Part 2 • [FEATURE] Reworked MenuImplementation • [TASK] Minor coding fixes for users management module • [BUGFIX] Remove obsolete route that might break routing • [TASK] Fix Page documentation in TS reference • [BUGFIX] Correctly rename site root nodes • [BUGFIX] Menu section collapse arrow styling • [BUGFIX] Headline alignment is not persisted • [BUGFIX] Shortcut rendering is broken in combination with layout • [BUGFIX] Dateselector should do "previous" too
TYPO3.TYPO3CR ! • [BUGFIX] Node references do not respect context workspace • [BUGFIX] Prevent database error with too long index • [BUGFIX] materialize NodeData in removeProperty() • [TASK] Fix wrong hint in method docblock ! TYPO3.TypoScript • [BUGFIX] isEven & isOdd not supported in TYPO3.Neos:ContentCollection
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 69 LOBACHER.
Features of TYPO3 Neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 70 TYPO3 Neos - the Compendium Features of TYPO3 Neos LOBACHER.
Features of TYPO3 Neos
• most extensible Enterprise CMF - Content Management Framework • based on the stable TYPO3 Flow Framework, already available in Version 2.0 • easy und flexible Content Export/Import (until now only via command line) • Multi-Domain Support • state-of-the-art Technology und Paradigms under the hood (DDD, AOP, RequireJS, EmberJS, ...) • Intuitive User Interface • Wireframe Mode - Content-Editing without Template • web based Package Management
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 71 TYPO3 Neos - the Compendium Features of TYPO3 Neos LOBACHER.
Features of TYPO3 Neos
• In-place Content-Editing • own Content Elements (incl. In-place Content-Editing) easily possible • Integration of TYPO3 Flow Applications as Plugins (packages) • TypoScript2 / Eel / FlowQuery • Workspaces (currently no multi user capabilities) • Custom Single-Sign-On / Custom Authentification through custom plugins • Audit Logging • TYPO3 Surf for the automatic Deployment (Integration with CI Server like Jenkins)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 72 TYPO3 Neos - the Compendium Features of TYPO3 Neos LOBACHER.
so far missing features ! • Web based Installer (currently needs command line with Root Access) • Multilingualism (Content & User Interface) • User / Roles without Admin Rights (Editors, well there is an„Editor User“, but so far it’s just a a „Non-Admin“) • User Rights / User Groups • ACLs (Access Control Lists) • Public Extensions (no Package Repository yet) • Shared Workspaces • Versioning (UI-Interface) • Non-Core-Features: News, connection to 3rd-Party-Systems, Slider, SSL, Google Analytics Integration, ... • REST
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 73 TYPO3 Neos - the Compendium Features of TYPO3 Neos LOBACHER.
so far missing features ! • Logs (User, Admin, ...) • SEO-Features (page properties: noindex, nofollow, keywords, description, canonical, ...) • proper RWD-Interface (Interface only works at approx. 1000px and bigger) • RWD-Rendering of Images (responsive web design) • Digital Asset Management (there’s no media browser) • Form Designer (currently one can only choose programmatically prepared forms) • Content Synchronization and Syndication • Admin Interface to edit arbitrary records • ...
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 74 LOBACHER.
Structure of the Neos user interface
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 75 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
Login
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 76 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
Publish Publish, possibility of User-Administration Structure of the Admin-Interface „auto publishing“ Logout and Settings Page Browser structural when clicking on the Operations Menu (pagetree) view arrow
Inspector content specific properties like page properties or the like
Preview Mode Display of how the page would look live
Preview Central e.g. display without design
Apply
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 77 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
selected element e.g. Headline, Content-Collection, Page, ... Properties Panel Properties context sensitive properties, e.g. page properties and the like
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 78 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
operations menu
Content switch between the different sites
Workspaces
Media Browser
User Management
Package Management
Sites Management
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 79 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
declaration administration of Workspaces of Publish Discard
selection of Node Type single changes
type of change
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 80 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
administration of Workspaces
Pages that contain modifications are marked orange
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 81 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
user administration View Edit Delete Role
add new user
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 82 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
user administration - new user
To add a new user simply provide username, password and personal data. Additionally the Role (Admin or Editor) is chosen.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 83 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
User Administration - editing
Here userdata can be edited and extended with a title or an alias. ! Additionally one can add an arbitrary amount of "electronic addresses" like Email addresses, Skype, etc. ! By chosing "primary" one selects the main address.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 84 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
User Administration - Info
The „Info“ Function gives an overview of all entered data.
A Click on „Delete“ opens a Lightbox, in which the requested action is confirmed and the user warned about the result.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 85 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
Freeze Deactivate Delete Package Administration & Unfreeze & Activate
select
actions on the selection
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 86 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
Site Administration Overview
Deactivate Edit Delete Status of this Site & Activate Add new Site
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 87 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
deactivate edit Domain Site Administration - Editing Domain
delete Domain
add Domain
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 88 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
Raw Content Mode - Display of the Elements without Design
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 89 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
Preview Central - alternative displays
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 90 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
insert (inside) Pagetree refresh
add new page delete the selected page edit page title
toggle visibility
copy page Cut
search in pagetree
double click to change filter the pagetree by Type page title (Page, Shortcut, …)
click on the page title
to view the page in the Drag&Drop preview to the right to move Page
91 (c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
structure tree
The structure tree lists all elements (visible and hidden) of the current page hierarchically.
The same Icons for functions like „New“, „Hide“, „Copy“ are available here as well.
A click on the Heading opens its properties in the inspector to the right and places the InPlace-Editor appropriately.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 92 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
Content-Funktionen add new Content cut copy Element after the Content Element Content Element selected „Insert“ appears as soon as one clicks „Copy“ or „Cut“
hide delete Content Element Content Element
93 (c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
add add add Link (format free) Clipboard Table Content Functions Paragraph Styles
self-explanatory? ;-)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 94 TYPO3 Neos - the Compendium Features of TYPO3 Neos - Screenshots LOBACHER.
add a Content Element
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 95 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
Multi-Column Content Elements
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 96 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
choose forms
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 97 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
Media Browser Upload View
Tagging
tag a file by drag&drop it onto the tag
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 98 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
Media Browser
Meta Data
Actions
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 99 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
Media- Upload Crop Image Handling Browser
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 100 TYPO3 Neos - the Compendium Features von TYPO3 Neos - Screenshots LOBACHER.
Cropping (unobstrusive)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 101 LOBACHER.
Internals of TYPO3 Neos
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 102 TYPO3 Neos - the Compendium TYPO3 Neos Internals: Node Structure LOBACHER.
Node Structure Site root ! • TYPO3CR Node Page • Node Name (serves as Identification)
• Node Type Content Section (e.g. Document, Folder, AbstractNode, Content, ContentCollection...) • Properties Content Element (dependent on NodeType)
Domain Model • easily extendible and easily configurable
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 103 TYPO3 Neos - the Compendium TYPO3 Neos Internals: Node Type LOBACHER.
Node Type ! • each TYPO3CR Node has a so-called Node Type
• Node Types are declared in each Package by defining them in the file Configuration/ NodeTypes.yaml
• Each Node Type can have one or more parent types. If specified, all properties and settings of the parent types are inherited
http://docs.typo3.org/neos/TYPO3NeosDocumentation/IntegratorGuide/ContentStructure.html#nodes-inside-the-typo3-content-repository
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 104 TYPO3 Neos - the Compendium TYPO3 Neos Internals: Node Type LOBACHER.
predefined Node Types: ! • TYPO3.Neos:Node This is the base type that should be extended by all Content-Types that are used in the Context of TYPO3 Neos. There are no properties whatsoever.
• TYPO3.Neos:Document An important differentiation is made between Nodes that act (and look) as a Page and „normal content“ like Text that is rendered on a page. Nodes that act like a page are called „Document Nodes“ in Neos which, for instance, have a unique and publicly visible URL in Neos. The default Page within Neos is implemented by the Node Type TYPO3.Neos.NodeTypes:Page which is directly extended from TYPO3.Neos:Document.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 105 TYPO3 Neos - the Compendium TYPO3 Neos Internals: Node Type LOBACHER.
predefined Node Types: ! • TYPO3.Neos:ContentCollection and TYPO3.Neos:Content Any content that acts as a page and resides in such a node is implemented through two different Node Types:
• TYPO3.Neos:ContentCollection type This Node Type serves structuring and usually does not contain any properties, but an ordered list of sub-nodes instead which are rendered inside this node. Currently one should not extend from this type when defining own node types. • TYPO3.Neos:Content This is the node type for all standard elements like „text“, „image“, „youtube“, ...
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 106 TYPO3 Neos - the Compendium TYPO3 Neos Internals: Node Zugriff LOBACHER.
Node Access ! • Access to the Nodes is happens through „NodePaths“ • Each Page is a node, so is every element on that page.
/sites/typo3org/home/subpage/main/text1
site root section pages content
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 107 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript LOBACHER.
TypoScript ! • TypoScript is a hierarchic, object oriented and prototype based processing language • Is used by Neos for flexible rendering of content • Objects are e.g. Array, Collection, Case, Menu, Page, Template, Plugin, Value, ... • Objects have properties that „configure“ the object • TypoScript has access to the respective „Context“ (e.g. pagetree of the Object „menu“ oder page properties of the object „page“) • There are "processors" that can change the value of properties (similar to the stdWrap functions of TYPO3 CMS) ! (c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 108 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript - Fluid Template LOBACHER.
TypoScript: Fluid Template {namespace neos=TYPO3\Neos\ViewHelpers} {namespace ts=TYPO3\TypoScript\ViewHelpers}
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 109 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript - Example - Part 1 LOBACHER.
TypoScript: Example - Part 1 include: NodeTypes/Carousel.ts2 namespace: TypoScript=TYPO3.TypoScript /** * Root TypoScript template for the Neos website */ page = Page { head { stylesheets.site = TypoScript:Template { templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/Page/Default.html' sectionName = 'stylesheets' } ! metadata = TypoScript:Template { templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/Page/Default.html' sectionName = 'metadata' } ! titleTag { // Overwrite the title tags content with a collection to create a breadcrumb content = TYPO3.TypoScript:Collection { // Retrieve all parent document nodes excluding the homepage collection = ${q(documentNode).add(q(documentNode).parents()).slice(0, -1).get()} itemName = 'node' iterationName = 'nodeIterator' // Implode node titles with a dash
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 110 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript - Example - Part 2 LOBACHER.
TypoScript: Example - Part 2 ! // This query checks if the second level menu has items and sets an additional class for the body bodyTag.attributes.class = ${q(node).parents().count() >= 1 && q(node).children('[instanceof TYPO3.Neos:Document]').filter('[_hiddenInIndex=false]').count() > 0 ? 'has-subpages' : ''} ! body { templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/Page/Default.html' sectionName = 'body' ! parts { mainMenu = Menu { entryLevel = 1 templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/ TypoScriptObjects/MainMenu.html' maximumLevels = 3 } secondLevelMenu = Menu { entryLevel = 2 templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/ TypoScriptObjects/SecondLevelMenu.html' maximumLevels = 1 }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 111 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript - Prozessoren LOBACHER.
TypoScript: Processors • Beispiel:
myObject = MyObject { property = 'Rocky' [email protected] = ${'My ' value + ' is the best!'} }
# results in 'My Rocky is the best!'
• can also be written as:
myObject = MyObject { property = 'some value' [email protected] { expression = ${'before ' + value + ' after'} @position = 'start' } }
• Processor are Eel Expressions or TypoScript Objects, which are applied to the value of the context. The current Object can be accessed via this.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 112 TYPO3 Neos - the Compendium TYPO3 Neos Internals: Eel - Embedded Expression Language LOBACHER.
Eel - Embedded Expression Language • While TypoScript contains Assignments and Processors, with Eel one can form expressions in the style of myObject.foo = ${q(node).property('bar')} • The Embedded Expression Language (Eel) is a component to create Domain Specific Languages (DSL). • Eel provides a comprehensive Syntax to create arbitrary expressions, so the author of the DSL can focus on the semantics
${foo.bar} // Traversal ${foo.bar()} // Method call ${foo.bar().baz()} // Chained method call
${foo.bar("arg1", true, 42)} // Method call with arguments ${12 + 18.5} // Calculations are possible ${foo == bar} // ... and comparisons
${foo.bar(12+18.5, foo == bar)} // everything combined ${[foo, bar]} // Array Literal ${{foo: bar, baz: test}} // Object Literal
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 113 TYPO3 Neos - the Compendium TYPO3 Neos Internals: FlowQuery LOBACHER.
FlowQuery • FlowQuery is a kind of jQuery for TYPO3 Flow • FlowQuery provides a way to process content (which is a TYPO3CR Node in Neos) with Eel • There are operations in FlowQuery: • property access to the properties of a node • filter filter expressions in „Fizzle“ • children returns all children of a TYPO3CR Node • parents returns all parents of a TYPO3CR Node • additional operations: add, count, first, get, is, last, ...
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 114 TYPO3 Neos - the Compendium TYPO3 Neos Internals: FlowQuery - Examples LOBACHER.
FlowQuery - Examples • amount of comments = amount of child elements of the current node whose name is "comments", having a property "spam" set to "false" numberOfComments = ${q(node).children('comments').children("[spam = false]").count()} • breadcrumb menu = current page + all parent pages prototype(TYPO3.Neos:Breadcrumb) < prototype(TYPO3.TypoScript:Template) { templatePath = 'resource://TYPO3.Neos/Private/Templates/TypoScriptObjects/ BreadcrumbMenu.html' node = ${node} items = ${q(node).add(q(node).parents('[instanceof TYPO3.Neos:Document]'))} } {namespace neos=TYPO3\Neos\ViewHelpers}
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 115 LOBACHER. technical details TypoScript
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 116 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript 2.0 - Overview
• because of the usage of TypoScript in TYPO3 CMS, TypoScript in TYPO3 Neos (and so in TYPO3 Flow) is referred to as TypoScript 2.0 • ultimately both versions merely share the name as they are implemented differently and therefore incompatible among each other • TypoScript is exclusively used for the rendering of content in the frontend (no more backend configuration as known before by TSconfig) • TypoScript is hierarchic, because it renders hierarchic content • TypoScript ist prototype based (like JavaScript), as it allows to change the properties of all instances at once • TypoScript is a processing language, because it processes the values in a context and transforms it into a single return value
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 117 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Objects
• TypoScript is a language to describe TypoScript Objects • A TypoScript Object has properties • TypoScript Objects have access to a „Context“, which in the end is a list of Variables • TypoScript transforms this Context by using the properties into some output • TypoScript can change this content internally and initiate the rendering of nested objects (TypoScript Tree) • TypoScript objects are realized by PHP Classes which are instantiated at runtime. Here one class can be the base of several different objects.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 118 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Objects
• Valid TypoScript would be like the following • Here TypoScript Paths are always noted in lowerCamelCase and Objects (Prototypes) in UpperCamelCase foo = Page my.object = Text my.image = TYPO3.Neos.ContentTypes:Image
• Value assignments foo.myProperty1 = 'Some Property which Page can access' my.object.myProperty1 = "Some other property" my.image.width = ${q(node).property('foo')} ! • Values that describe strings have to be enclosed by quotation marks (single or double). Eel expressions are valid values as well.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 119 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Syntax
• One can note TypoScript in curly braces, i.e. the path before the opening brace is prepended to all paths inside the braces. my { image = Image image.width = 200 object { myProperty1 = 'some property' } } • This is identical to the following Code my.image = Image my.image.width = 200 my.object.myProperty1 = 'some property' !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 120 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Object Instantiation
• Besides, it's possible to assign values at instantiation as shown in the third example (all examples act the same):
someImage = Image someImage.foo = 'bar'
someImage = Image someImage { foo = 'bar' }
someImage = Image { foo = 'bar' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 121 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript Objects are free of side-effects
• While TypoScript Objects can change their context they are free of side-effects.
• The context is "cleaned" after the usage of a TypoScript object, even if it has been altered before. ! • TypoScript objects can only alter nested TypoScript objects, but not objects "before" or "after" them
• So a TypoScript path in combination with its context always acts the same, no matter at which place it's called
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 122 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Prototypes
• When a TypoScript Object is instantiated (because someone issued someImage = Image), then the prototype of this object is copied and is used as the base of this new object (someImage). • A Prototype is defined as followed: prototype(MyImage) { width = '500px' height = '600px' } • Now one can use this object: # The Object someImage has a width of 500px and a height of 600 px someImage = MyImage # Now the width is 100px (and the height stays at 600px) someImage.width = '100px'
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 123 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Prototypes
• Prototypes are modifiable:
prototype(MyYouTube) { width = '100px' height = '500px' }
# with this the width for all Instances # is changed to 400px prototype(MyYouTube).width = '400px'
# One can also define new properties prototype(MyYouTube).showFullScreen = ${true}
# Prototypen can also be „inherited“ prototype(MyImage) < prototype(TYPO3.Neos:Content)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 124 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Prototypes
• By Inheritance, prototypes are "bound" to each other. If one property changes in one instance, it is also changed in the other.
prototype(TYPO3.Neos.Content).fruit = 'apple' prototype(TYPO3.Neos.Content).meal = 'dinner'
# MyImage now has the properties "fruit = apple" and "meal = dinner" prototype(MyImage) < prototype(TYPO3.Neos:Content)
# Because of MyImage *extending* the Object Template, # MyImage.fruit likewise has the value 'Banana' prototype(TYPO3.Neos:Content).fruit = 'Banana'
• # Because the property „meal“ is overwritten in the child class, # an overwriting in the parent class no longer has any effect prototype(MyImage).meal = 'breakfast' prototype(TYPO3.Neos:Content).meal = 'supper'
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 125 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Prototypes
• Prototype inheritance is only possible on a global scope
prototype(Foo) < prototype(Bar)
• therefore the following instructions would not be possible
prototype(Foo) < some.prototype(Bar) other.prototype(Foo) < prototype(Bar) prototype(Foo).prototype(Bar) < prototype(Baz)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 126 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Prototypes
• hierarchic TypoScript Prototypes
# Set the property „bar“ (resp. „some.thing“) for all objects of type „Foo“ prototype(Foo).bar = 'baz' prototype(Foo).some.thing = 'baz2'
# Set the property „some“ for all objects of type „Foo“, which are inside the # path „some.path“ some.path.prototype(Foo).some = 'baz2'
# Set the property „some“ for all objects of type „Bar“ # which are inside of objects of type „Foo“ prototype(Foo).prototype(Bar).some = 'baz2'
# combination of all possibilities above prototype(Foo).left.prototype(Bar).some = 'baz2'
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 127 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Namespaces
• Namespaces can be used at declaration
# defines a Namespace „Acme.Demo“ for the prototype „YouTube“ prototype(Acme.Demo:YouTube) { width = '100px' height = '500px' }
• This Namespace is by convention the package key of the package where the TypoScript resides
• Full Qualified Namespaces can be used:
prototype(TYPO3.Neos:ContentCollection.Default) < prototype(TYPO3.Neos:Collection)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 128 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Namespaces
• By omitting a Namespace, the default Namespace TYPO3.Neos is used instead. • A Namespace directive can be used to create an own Namespace:
namespace Foo = Acme.Demo
# The following instructions are identical video = Acme.Demo:YouTube video = Foo:YouTube
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 129 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Properties
• Even though TypoScript objects can access the context directly, one should use properties # We assume a property in the current context # "foo=bar" myObject = MyObject
# the value of the current context's variable "foo" # is explicitly assigned to the "foo" property of "myObject" myObject.foo = ${foo}
• Objects shall exclusively use own properties to generate Output
• Merely at prototype definition one can access the context directly: prototype(MyObject).foo = ${foo}
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 130 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: manipulation of the context
• The TypoScript Context kann be manipulated directly by using the meta property @override:
myObject = MyObject [email protected] = ${foo * 2}
• The above code creates an additional context variable with the name bar and the doubled value of foo. ! ! ! !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 131 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Processors
• Processors allow to manipulate TypoScript properties:
myObject = MyObject { property = 'some value' [email protected] = ${'before ' + value + ' after'} } # results in 'before some value after' ! ! • usage of multiple processors is possible • The order follows the numerical position in the TypoScript (after @process). Following above's example, @process.2 further processes the result of @process.1. ! !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 132 TYPO3 Neos - the Compendium Technical Details - TypoScript LOBACHER.
TypoScript: Processors • An extended Syntax can be used for processors
myObject = MyObject { property = 'some value' [email protected] { expression = ${'before ' + value + ' after'} @position = 'start' } } # results in 'before some value after' ! • A name (here „someWrap“) can be used using this syntax. • Processors are Eel Expressions resp. TypoScript Objects which are applied to value of the context. The current object can be accessed via this
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 133 LOBACHER.
Neos TypoScript Reference
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 134 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Array (Part 1)
• renders the nested TypoScript Objects and concatenates its Output • the @position argument specifies the order of precedence • for this argument the following ranking order applies • start [priority] The higher the priority the earlier the object is added. If there is no priority given, the element will be sorted after any elements with priority. • [numeric ordering] Position (sorted ascending) • end [priority] The higher the priority the later the object is added. If there is no priority given, the element will be sorted before any elements with priority.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 135 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Array (Part 2)
• furthermore an element can be defined to be sorted before or after a specific element:
• before [namedElement] [optionalPriority] Adds this element before the element „namedElement“; in case of multiple statements the higher the priority, the more it will be placed before „namedElement“. Statements without priority will be placed furthest in front of the element. If „namedElement“ doesn’t exist, the element will be placed after all „start“ positions. • after [namedElement] [optionalPriority] analogously to „before“, but the other way round („after namedElement“, „before all end positions“, …)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 136 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Array (Part 3) (o = lower case letter / „order“)
myArray = TYPO3.TypoScript:Array { o1 = TYPO3.Neos.NodeTypes:Text o1.@position = 'start 12' o2 = TYPO3.Neos.NodeTypes:Text o2.@position = 'start 5' o2 = TYPO3.Neos.NodeTypes:Text o2.@position = 'start' ! o3 = TYPO3.Neos.NodeTypes:Text o3.@position = '10' o4 = TYPO3.Neos.NodeTypes:Text o4.@position = '20' ! o5 = TYPO3.Neos.NodeTypes:Text o5.@position = 'before o6' ! o6 = TYPO3.Neos.NodeTypes:Text o6.@position = 'end' o7 = TYPO3.Neos.NodeTypes:Text o7.@position = 'end 20' o8 = TYPO3.Neos.NodeTypes:Text o8.@position = 'end 30' !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 137 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Collection (Part 1)
• iterates on an Array-like „collection“ and renders each element through itemRenderer
(array/iterable, required) collection The Array or the Iterable over which is iterated.
(string, required) The name under which the element of the current iteration itemName can be accessed.
(string) Contains meta information of the Iteration: index (begins at iterationName 0), cycle (begins at 1), isFirst, isLast.
This TypoScript Object is called on each iteration and its itemRenderer (nested TypoScript object) result is concatenated.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 138 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Collection (Part 2) myCollection = TYPO3.TypoScript:Collection { collection = ${[1, 2, 3]} itemName = 'element' itemRenderer = TYPO3.TypoScript:Template itemRenderer.templatePath = '...' itemRenderer.element = ${element} }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 139 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Case !
• Evaluates all nested Conditions until the first returns TRUE. This acts like PHP’s switch/case structure and continues if myCase is equal to a specified type. „fallback“ is executed accordingly to PHP’s switch/case „default“.
myCase = TYPO3.TypoScript:Case myCase { someCondition { condition = ${... some eel expression evaluating to TRUE or FALSE ... } type = 'MyNamespace:My.Special.Type' } fallback { condition = ${true} type = 'MyNamespace:My.Default.Type' } }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 140 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Template (Part 1)
• renders a Fluid-Template, referenced through templatePath
(string, required) templatePath the template, prefixed with e.g. resource://
(string) partialRootPath the path where the Partials can be found
(string) layoutRootPath the path where the Layouts can be found
the Fluid Section
[variables] (any) all other strings are passed as variables to the View
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 141 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Template (Part 2) myTemplate = TYPO3.TypoScript:Template { templatePath = 'resource://My.Package/Private/path/to/ Template.html' someDataAvailableInsideFluid = 'my data' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 142 TYPO3 Neos - the Compendium Neos TypoScript - Reference LOBACHER.
TYPO3.TypoScript:Value
• this is a wrapper for a value
(mixed, required) value the value
myValue = Value { value = 'Hello World' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 143 LOBACHER.
Technical Details Eel
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 144 TYPO3 Neos - the Compendium Technical Details - Eel LOBACHER.
Eel - Embedded Expression Language
• next to easy TypoScript assignments like myObject.foo = 'bar' it‘s easy to form expressions like myObject.foo = ${q(node).property('bar')} using Eel. • every Eel expression is noted by ${... • Eel is similar to JavaScript • Eel does not support variable assignments or control structures • Eel supports the usual JavaScript Operators for arithmetic and comparisons • Eel supports the ternary operator:
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 145 TYPO3 Neos - the Compendium Technical Details - Eel LOBACHER.
Eel - examples
• the following are examples of valid expressions: • Eel itself does not define own functions or variables, instead it uses the Eel Context Array where functions and objects, one would like to access, can be defined • Therefore Eel is perfect for the construction of a "domain specific language" which defines the syntax, but does not provide the semantics of such a DSL • For Eel inside of TypoScript the semantics is defined as follows: • all Variables of the TypoScript Context are accessible inside the Eel Context • the special variable this always points to the current TypoScript Object Implementation • there is a function q(), which wraps its arguments into a FlowQuery object !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 146 TYPO3 Neos - the Compendium Technical Details - Eel LOBACHER.
Eel - Sematic
• the following are examples of valid expressions:
${foo.bar} // Traversal ${foo.bar()} // Method call ${foo.bar().baz()} // Chained method call
${foo.bar("arg1", true, 42)} // Method call with arguments ${12 + 18.5} // Calculations are possible ${foo == bar} // ... and comparisons
${foo.bar(12+18.5, foo == bar)} // everything combined ${[foo, bar]} // Array Literal ${{foo: bar, baz: test}} // Object Literal !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 147 LOBACHER.
Technical Details FlowQuery
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 148 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - jQuery for Flow
• FlowQuery represents the idea of jQuery for Flow and as such has been strongly inspired by it • FlowQuery is a way to process content (which is a TYPO3CR Node inside of Neos) in an Eel Context • FlowQuery Operations are implemented through PHP Classes • the respective package containing a specific FlowQuery Operation has to be installed • each Package can add its own FlowQuery Operations • the TYPO3.Eel Package contains a set of basic operations
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 149 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - Examples
• access a Context Variable ${myContextVariable}
• access the current node ${node}
• access node properties ${q(node).getProperty('foo')} // possible, but not recommended ${q(node).property('foo')} // better: use FlowQuery
• assign to a variable text = ${q(node).property('text')}
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 150 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - Examples
• discover all parent nodes of a node ${q(node).parents()}
• discover the first node inside a sub-node with the name „left“ ${q(node).children('left').first()} ${q(node).children().filter('left').first()}
• discover all parent nodes and add the current node ${node.parents().add(node)}
• discover the amount of nodes whose children inside of „comments“ having a property „spam“ set to „false“: numberOfComments = ${q(node).children('comments').children("[spam = false]").count()}
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 151 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - add Operation (TYPO3.Eel)
• the add operation adds an additional flowQuery Object to the current
• Example: items = ${q(node).add(q(node).parents())}
Here, the current node is determined and all parent nodes are added. This, for example, is used to create a breadcrumb navigation. It is achieved by the help of the statement above which provides a rootline of the nodes.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 152 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - count Operation (TYPO3.Eel)
• The count operation returns the amount of objects (or Array items)
• Example: test.value = ${q(node).add(q(node).parents()).count()}
The rootline is determined and enumerated by count() whose value is returned.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 153 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - first Operation (TYPO3.Eel)
• the „first“ operation returns the first object
• Example: test.value = ${q(node).add(q(node).parents()) .first().property('title')}
At first the rootline is determined, afterwards the first element is selected by first() and this element's property 'title' is returned.
If there are two pages: Home > Compendium, then „Compendium“ is returned.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 154 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - get Operation (TYPO3.Eel)
• If FlowQuery is used, the result is again a FlowQuery object. The get operation "frees" the result from the "Flow Query".
• Example: test.value = ${q(node).add(q(node).parents()).first().get(0)}
The rootline is determined and by first() the first element is selected. Using get() the result is now transformed into an array (without it would be a FlowQuery object) and the first element is returned.
If there are two pages: Home > Compendium, the following is returned:
Node /sites/demo/homepage/Compendium[TYPO3.Neos:Page]
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 155 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - if Operation (TYPO3.Eel)
• checks if at least one of the elements in the current context matches a given filter
• Example: test.value = ${q(node).if('[instanceof TYPO3.Neos:Page]') ? 'Page' : 'No Page'}
The if operator first checks if the current node is an instance of type TYPO3.Neos:Page (a normal page). If that is the case "Page" is returned otherwise "No Page".
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 156 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - last Operation (TYPO3.Eel)
• the last operation returns the last object
• Example: test.value = ${q(node).add(q(node).parents()) .last().property('title')}
At first the rootline is determined, afterwards the last element is selected by last() and this element's property 'title' is returned.
If there are two pages: Home > Compendium, then „Home“ is returned.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 157 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - slice Operation (TYPO3.Eel)
• applies the „Slice“ Operation to a Set of Results
• Beispiel: ${q(site).find('fr/blog').children('[instanceof Namespace.Plugin.Blog:Post]').slice()} ${q(site).find('fr/blog').children('[instanceo Namespace.Plugin.Blog:Post]').slice(2)} ${q(site).find('fr/blog').children('[instanceof Namespace.Plugin.Blog:Post]').slice(0, 2)}
The last two statements return the two last blog posts.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 158 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - property Operation (TYPO3.Eel)
• the property operation returns a property of an object • if the property begins with _ (an underscore), internal values are returned, e.g.: • _path (Node Path) • _nodeType.name (Node Type)
• Example: test.value = ${q(node).property('_path')}
returns the property „title“ of the current node.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 159 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - children Operation (TYPO3.Eel)
• The children operation returns the child objects of the current object. Inside a page these are the sections or content areas. • It is possible to a filter option: ...children('main')...
• Example: test.value = ${q(node).children().property('_path')}
Ergebnis: /sites/demo/homepage/Compendium/compendium1/main
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 160 TYPO3 Neos - the Compendium Technical Details - FlowQuery LOBACHER.
FlowQuery - filter Operation (TYPO3.Eel)
• The filter operation limits the result‘s set of objects. The filter expression is noted in Fizzle and supports the following operators: • = (equality) • $= (value ends with the operand) • ^= (value begins with the operand) • *= (value contains the operand) • instanceof (checks if the value is an instance of the operator)
• Example: test.value = ${q(node).children().filter('main'). first().property('_path')}
Returns the property „_path“ of the first child node in the path „main“.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 161 LOBACHER.
Technical Details Fizzle
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 162 TYPO3 Neos - the Compendium Technical Details - Fizzle LOBACHER.
Fizzle • filter Operations (e.g. filter() in FlowQuery) are written in Fizzle • Property Name Filters • This can be the first part of a filter, like foo, foo.bar or foo.bar.baz • Attribute Filter • baz[foo] • baz[answer = 42] • baz[foo = "Bar"] • baz[foo = 'Bar'] • baz[foo ^= "Bar"] • baz[foo $= "Bar"] • baz[foo *= "Bar"] • Operators • = (equality) • $= (value ends with the operand) • ^= (value begins with the operand) • *= (value contains the operand) • instanceof (checks if the value is an instance of the operator)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 163 LOBACHER.
Technical Details NodeTypes.yaml
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 164 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Structure of the File: NodeTypes.yaml
• Each TYPO3CR Node (subsequently just named Node) has a specific Node Type. • Configuration of Node Types is done via the Package’s (resp. the Site’s) Configuration/NodeTypes.yaml • Each Node can has one or more parent types. All Properties and Settings are inherited from the parents.
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 165 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: the body of a node
• Start-Declaration of a Node:
'Namespace.PackageName:NodeName': resp. 'Namespace.SiteName:NodeName':
• The Start-Declaration can have the following properties: • superTypes: • childNodes: • abstract: • ui: • properties: • validation:
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 166 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: superTypes
• This is an Array of parent nodes which the current node extends.
'Namespace.PackageName:NodeName': resp. 'Namespace.SiteName:NodeName':
• Examples: 'My.Package:SpecialHeadline': superTypes: ['TYPO3.Neos:Content']
'TYPO3.Neos:Document': superTypes: - 'TYPO3.Neos:Node' - 'TYPO3.Neos:Hidable'
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 167 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: childNodes
• A list of child nodes that are automatically added when a Node of this type is added. For each child node the respective node type has to be specified.
• Examples:
childNodes: someChild: type: 'TYPO3.Neos:ContentCollection'
'TYPO3.NeosDemoTypo3Org:Carousel': superTypes: ['TYPO3.Neos:Content'] childNodes: carouselItems: type: 'TYPO3.Neos:ContentCollection'
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 168 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: ui
• available options for the Node Type’s UI-Representation
• label: The label that is shown • group: Name of the group inside the „New Content Element“ Dialog, in which the Element is sorted. Possible default values are: general, structure, plugins (Packages/Application/TYPO3.Neos/Configuration/Settings.yaml) • icon: Defines the Icon - The Range is restricted to „Font Awesome“ (http:// docs.pagelines.com/tutorials/font-awesome) - e.g. icon-align-center • inlineEditable: indicates if a direct interaction possibility with the node
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 169 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: ui
• available options for the Node Type’s UI-Representation
• inspector: configures the Inspector inside the NEOS UI for this Node Type • groups: defines an Inspector Group, for grouping the settings later • label: the Label for the Inspector Group • position: declares the position of the Inspector Group - the lower the number, the higher its position (and vice versa)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 170 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: properties
• Contains a list of named properties. For each of these properties the following settings apply. • type: Defines the Datentype of the property. Possible values are Simple Type (PHP), an FQCN (Fully qualified class name), or one of the three special types: data, reference or references. Use „data“ for DateTime, for a reference to other Nodes „reference“ (for one) or „references (für many). • defaultValue: Default Value • validation: Declaration of the validation class (e.g. TYPO3.Neos/Validation/ NotEmptyValidator) - incl. their options ! !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 171 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: properties
• Contains a list of named properties. For each of these properties the following settings apply.
• ui: • label: the label that is shown • reloadIfChanged: Angabe, ob das Elemente bei Änderungen neu gerendert wird • inlineEditable: direct changes of the element are possible • aloha: configures the options of the Aloha-Editor (which functions are permitted and which are not) !
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 172 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: properties
• Contains a list of named properties. For each of these properties the following settings apply.
• ui: • inspector: • group: the group, the Element will be sorted in (this is defined via ui.inspector.groups) • position: position of the element - the lower the number, the higher its position • editor: Name of the JavaScript Editor class • editorOptions: Options for the Editor
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 173 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: Examples
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 174 TYPO3 Neos - the Compendium Technical Details - NodeTypes.yaml LOBACHER.
Node-Declaration: Examples
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 175 LOBACHER.
Structure of the TYPO3 Neos Rendering
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 176 TYPO3 Neos - the Compendium The directory structure of a TYPO3 Flow base LOBACHER.
The directory structure of a TYPO3 Flow base:
Files for the build process (Behat, Phing, ...) Neos Configuration (Context, Routes, Settings, PackageStates...) Data (Logs, Setup-Key, Caches, ...) Packages (Application, Framework, Libraries, Sites) Tests (Selenium-Tests) Document Root
Flow Command Line Interface
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 177 TYPO3 Neos - the Compendium The directory structure of a TYPO3 Neos Site LOBACHER.
The directory structure of a TYPO3 Neos Site:
starting point of the TYPO3 Neos Site
Classes (e.g. regisitration Classes)
Configuration (e.g. Node Types)
Private Ressources (e.g. Content, Templates, TypoScript, ...)
public Ressources (Assets, like CSS, Fonts, Images, JS, ...)
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 178 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript - sequence of loading - Root.ts2 ! • the rendering in TYPO3 Neos is completely realized in TypoScript 2 • At first the following file is loaded and its content interpreted:
Packages/Application/TYPO3.Neos/Resources/Private/TypoScript/Root.ts2
Warning: The resource path omits the „Resources“ part of the physical path!
$mergedTypoScriptCode = $this->readExternalTypoScriptFile('resource:// TYPO3.Neos/Private/TypoScript/Root.ts2') . $siteRootTypoScriptCode;
• Afterwards the following file is loaded - it contains the TypoScript Code of the own Site: Packages/Sites/[Vendor.Sitename]/Resources/Private/Typoscripts/Library/Root.ts2
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 179 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: Root.ts2 (TYPO3.Neos) ! • the file Root.ts2 (Packages/Application/TYPO3.Neos/Resources/Private/ TypoScript/Root.ts2) in the TYPO3.Neos Resources directory subsequently loads the following files:
include: resource://TYPO3.TypoScript/Private/TypoScript/Root.ts2 include: resource://TYPO3.Neos/Private/TypoScript/DefaultTypoScript.ts2 include: resource://TYPO3.Neos/Private/TypoScript/RawContentMode.ts2 include: resource://TYPO3.Neos.NodeTypes/Private/TypoScript/Root.ts2
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 180 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: Root.ts2 (TYPO3.TypoScript) - Part 1 ! • The file Root.ts2 in the TYPO3.TypoScript Resources directory defines 9 classes for the respective objects Array, RawArray, Template, Collection, Case, Matcher, Value, Tag and UriBuilder. The classes are located at Packages/TYPO3.TypoScript/Classes/TYPO3/TypoScript/TypoScriptObjects:
prototype(TYPO3.TypoScript:Array).@class = 'TYPO3\\TypoScript\ \TypoScriptObjects\\ArrayImplementation'
prototype(TYPO3.TypoScript:RawArray).@class = 'TYPO3\\TypoScript\ \TypoScriptObjects\\RawArrayImplementation'
prototype(TYPO3.TypoScript:Template).@class = 'TYPO3\\TypoScript\ \TypoScriptObjects\\TemplateImplementation'
prototype(TYPO3.TypoScript:Collection).@class = 'TYPO3\\TypoScript\ \TypoScriptObjects\\CollectionImplementation'
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 181 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: Root.ts2 (TYPO3.TypoScript) - Part 2 ! • prototype(TYPO3.TypoScript:Case).@class = 'TYPO3\\TypoScript\\TypoScriptObjects \\CaseImplementation'
prototype(TYPO3.TypoScript:Matcher).@class = 'TYPO3\\TypoScript\ \TypoScriptObjects\\MatcherImplementation'
prototype(TYPO3.TypoScript:Value).@class = 'TYPO3\\TypoScript\ \TypoScriptObjects\\ValueImplementation'
prototype(TYPO3.TypoScript:Tag) { @class = 'TYPO3\\TypoScript\\TypoScriptObjects\\TagImplementation' attributes = RawArray }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 182 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: Root.ts2 (TYPO3.TypoScript) - Part 3 ! • # Renders attributes of a HTML tag # # Usage: # attributes = TYPO3.TypoScript:Attributes { # foo = 'bar' # class = TYPO3.TypoScript:RawArray { # class1 = 'class1' # class2 = 'class2' # } # } # prototype(TYPO3.TypoScript:Attributes) { @class = 'TYPO3\\TypoScript\\TypoScriptObjects\\AttributesImplementation' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 183 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: Root.ts2 (TYPO3.TypoScript) - Part 4 ! • # Renders an HTML tag # # Usage: # tag = TYPO3.TypoScript:Attributes { # tagName = 'h1' # attributes = { # class = 'some-class' # } # } # prototype(TYPO3.TypoScript:Tag) { @class = 'TYPO3\\TypoScript\\TypoScriptObjects\\TagImplementation' attributes = TYPO3.TypoScript:Attributes omitClosingTag = FALSE selfClosingTag = FALSE }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 184 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: Root.ts2 (TYPO3.TypoScript) - Part 5 ! • # Renders an URI pointing to a controller/action # # Usage: # uri = TYPO3.TypoScript:UriBuilder { # package = 'Some.Package' # controller = 'Standard' # action = 'index' # } # prototype(TYPO3.TypoScript:UriBuilder) { @class = 'TYPO3\\TypoScript\\TypoScriptObjects\\UriBuilderImplementation' additionalParams = RawArray arguments = RawArray argumentsToBeExcludedFromQueryString = RawArray @exceptionHandler = 'TYPO3\\TypoScript\\Core\\ExceptionHandlers\ \AbsorbingHandler' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 185 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: Root.ts2 (TYPO3.TypoScript) - Part 6 ! • # Renders an URI pointing to a resource # # Usage: # fileUri = TYPO3.TypoScript:ResourceUri { # path = 'resource://Some.Package/Public/Images/SomeImage.png' # } # prototype(TYPO3.TypoScript:ResourceUri) { @class = 'TYPO3\\TypoScript\\TypoScriptObjects\\ResourceUriImplementation' localize = TRUE @exceptionHandler = 'TYPO3\\TypoScript\\Core\\ExceptionHandlers\ \AbsorbingHandler' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 186 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • Hier werden zunächst die Prototypen-Definitionen geladen:
include: Prototypes/ContentCase.ts2 include: Prototypes/Document.ts2 include: Prototypes/Content.ts2 # Note: The TYPO3.Neos:Template prototype only exists for historical reasons and will be removed in a future version: include: Prototypes/Template.ts2 include: Prototypes/PrimaryContent.ts2 include: Prototypes/ContentCollection.ts2 include: Prototypes/Page.ts2 include: Prototypes/Shortcut.ts2 include: Prototypes/Breadcrumb.ts2 include: Prototypes/Menu.ts2 include: Prototypes/Plugin.ts2 include: Prototypes/PluginView.ts2 include: Prototypes/ConvertNodeUris.ts2 include: Prototypes/DocumentMetadata.ts2 include: Prototypes/ContentElementWrapping.ts2
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 187 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) - Beispiel ! • Als Beispiel Prototypes/Breadcrumb.ts2
# TYPO3.Neos:Breadcrumb provides a basic breadcrumb navigation # prototype(TYPO3.Neos:Breadcrumb) < prototype(TYPO3.TypoScript:Template) { templatePath = 'resource://TYPO3.Neos/Private/Templates/TypoScriptObjects/ BreadcrumbMenu.html' node = ${node} items = ${q(node).add(q(node).parents('[instanceof TYPO3.Neos:Document]'))} @exceptionHandler = 'TYPO3\\Neos\\TypoScript\\ExceptionHandlers\ \NodeWrappingHandler' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 188 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • next the default TYPO3.Neos TypoScript is loaded and interpreted • Here the Object TYPO3.Neos:ContentCase is inherited from the Object TYPO3.TypoScript:Case and the properties @position, condition and type have default values applied. • the "case" TypoScript Object renders its child elements
# TYPO3.Neos:ContentCase inherits TYPO3.TypoScript:Case and overrides the default case # with a catch-all condition for the default case, setting the type variable to # the name of the current nodes' node type # prototype(TYPO3.Neos:ContentCase) < prototype(TYPO3.TypoScript:Case) { default { @position = 'end' condition = TRUE type = ${q(node).property('_nodeType.name')} } }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 189 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • The Object TYPO3.Neos:Document is inherited from TYPO3.TypoScript:Template and the properties of node are set to the current node.
# This is the base Document TypoScript object # It should be extended by all TypoScript objects which render documents or are based on node types extending # TYPO3.Neos:Document. # # Note: This object inherits from TYPO3.TypoScript:Template because most Document types are expected to contain a # Fluid template. If a Document-based TypoScript object should not render a template you should still extend this # prototype and override the @class property. # prototype(TYPO3.Neos:Document) < prototype(TYPO3.TypoScript:Template) { node = ${node} }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 190 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • The Object TYPO3.Neos:Template is inherited from TYPO3.TypoScript:Template # This is the base Content TypoScript object # It must be extended by all elements that are selectable in the backend # Note: This object inherits from TYPO3.TypoScript:Template cause most Content Elements are expected to contain a # Fluid template. If a Content Element does not render a template (like for the Plugin Content Elements) # you should still extend this prototype and override the @class property (see TYPO3.Neos:Plugin). prototype(TYPO3.Neos:Content) < prototype(TYPO3.TypoScript:Template) { node = ${node} attributes = TYPO3.TypoScript:Attributes attributes.class = '' # The following is used to automatically append a class attribute that reflects the underlying node type of a TypoScript object, # for example "typo3-neos-nodetypes-form", "typo3-neos-nodetypes-headline", "typo3-neos-nodetypes- html", "typo3-neos-nodetypes-image", "typo3-neos-nodetypes-menu" and "typo3-neos-nodetypes-text" # You can disable the following line with: # prototype(TYPO3.Neos:Content) # [email protected] > # } # in your site's TypoScript if you don't need that behavior. [email protected] = ${String.trim(value + ' ' + String.toLowerCase(String.pregReplace(q(node).property('_nodeType.name'), '/[[:^alnum:]]/', '-')))} # The following line must not be removed as it adds required meta data to all content elements in backend @process.contentElementWrapping = TYPO3.Neos:ContentElementWrapping @exceptionHandler = 'TYPO3\\Neos\\TypoScript\\ExceptionHandlers\\NodeWrappingHandler' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 191 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • The Object TYPO3.Neos:Template is initialized (Deprecated!)
# This TypoScript object only exists as a reminder for migrating your code to the newer TypoScript object structure. # Please use TYPO3.TypoScript:Template instead or TYPO3.Neos:Content if you're creating a content element. # prototype(TYPO3.Neos:Template) { @class = 'TYPO3\\Neos\\TypoScript\\TemplateImplementation' }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 192 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • The Object TYPO3.Neos:PrimaryContent is inherited from TYPO3.TypoScript:Case. # Primary content should be used to render the main content of a site and # provides an extension point for other packages # prototype(TYPO3.Neos:PrimaryContent) < prototype(TYPO3.TypoScript:Case) { nodePath = 'to-be-defined-by-user'
@override.nodePath = ${this.nodePath} @ignoreProperties = ${['nodePath']}
default { prototype(TYPO3.Neos:ContentCollection) { nodePath = ${nodePath} } condition = TRUE type = 'TYPO3.Neos:ContentCollection' @position = 'end' } }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 193 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • The Object TYPO3.Neos:ContentCollection is initialized, which itself can accept Content Elements.
# Default case for ContentCollection TS Object # prototype(TYPO3.Neos:ContentCollection) < prototype(TYPO3.Neos:Content) { @class = 'TYPO3\\Neos\\TypoScript\\ContentCollectionImplementation'
nodePath = 'to-be-set-by-user'
itemName = 'node' itemRenderer = TYPO3.Neos:ContentCase
attributes.class = 'neos-contentcollection'
@override.contentCollectionNode = ${q(node).is('[instanceof TYPO3.Neos:ContentCollection]') ? node : q(node).find(this.nodePath).get(0)}
@process.contentElementWrapping node = ${contentCollectionNode} } }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 194 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • Part 1: The Object TYPO3.Neos:Page is inherited from TYPO3.TypoScript:Array.
# TYPO3.Neos:Page is the default object used for rendering in most sites # prototype(TYPO3.Neos:Page) > prototype(TYPO3.Neos:Page) < prototype(TYPO3.TypoScript:Array) {
doctype = '' doctype.@position = 'start 100'
# Only the opening html tag for the page. This is done to avoid deep nesting of TypoScript paths for integrators. htmlTag = TYPO3.TypoScript:Tag { @position = 'start' tagName = 'html' omitClosingTag = TRUE attributes { version = 'HTML+RDFa 1.1' xmlns = 'http://www.w3.org/1999/xhtml' xmlns:typo3 = 'http://www.typo3.org/ns/2012/Flow/Packages/Neos/Content/' xmlns:xsd = 'http://www.w3.org/2001/XMLSchema#' } }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 195 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • Part 2: The Object TYPO3.Neos:Page is inherited from TYPO3.TypoScript:Array.
headerComment = TYPO3.TypoScript:Template { @position = 'before headTag' templatePath = 'resource://TYPO3.Neos/Private/Templates/TypoScriptObjects/ NeosLicenseHeader.html' }
# The opening head tag for the page. This is done to avoid deep nesting of TypoScript paths for integrators. headTag = TYPO3.TypoScript:Tag { @position = 'after htmlTag' tagName = 'head' omitClosingTag = TRUE }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 196 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • Part 3: The Object TYPO3.Neos:Page is inherited from TYPO3.TypoScript:Array. # The content of the head tag, integrators can add their own head content in this array. head = TYPO3.TypoScript:Array { @position = 'after headTag' characterSetMetaTag = TYPO3.TypoScript:Tag { @position = 'start 10' tagName = 'meta' attributes { charset = 'UTF-8' } } titleTag = TYPO3.TypoScript:Tag { tagName = 'title' content = ${q(node).property('title')} } neosBackendHeader = TYPO3.TypoScript:Template { @position = 'end 10000' templatePath = 'resource://TYPO3.Neos/Private/Templates/TypoScriptObjects/ NeosBackendHeaderData.html' node = ${node} } # Script includes in the head should go here javascripts = TYPO3.TypoScript:Array # Link tags for stylesheets in the head should go here stylesheets = TYPO3.TypoScript:Array }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 197 TYPO3 Neos - the Compendium TYPO3 Neos Internas: TypoScript Reihenfolge LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • Part 4: The Object TYPO3.Neos:Page is inherited from TYPO3.TypoScript:Array. closingHeadTag = '' closingHeadTag.@position = 'after head' # The opening body tag for the page. This is done to avoid deep nesting of TypoScript paths for integrators. bodyTag = TYPO3.TypoScript:Tag { @position = '20' tagName = 'body' omitClosingTag = TRUE } # Required for the backend to work. neosBackendDocumentNodeData = TYPO3.Neos:DocumentMetadata { @position = 'before body' } # Content of the body tag. To be defined by the integrator. body = TYPO3.TypoScript:Template { @position = 'after bodyTag' node = ${node}
# Script includes before the closing body tag should go here javascripts = TYPO3.TypoScript:Array # This processor appends the rendered javascripts Array to the rendered template @process.appendJavaScripts = ${value + this.javascripts} }
(c) 2014 - Patrick Lobacher | TYPO3 Neos 1.0.2 - the Compendium | 2014-03-07 | www.lobacher.de 198 TYPO3 Neos - the Compendium TYPO3 Neos Internals: TypoScript Sequence of Execution LOBACHER.
TypoScript: DefaultTypoScript.ts2 (TYPO3.Neos) ! • Part 5: The Object TYPO3.Neos:Page is inherited from TYPO3.TypoScript:Array. # Required for the backend to work. neosBackendContainer = TYPO3.TypoScript:Template { @position = 'before closingBodyTag' templatePath = 'resource://TYPO3.Neos/Private/Templates/TypoScriptObjects/ NeosBackendContainer.html' node = ${node} } # This enables redirecting to the last visited page after login lastVisitedNodeScript = Tag { @position = 'before closingBodyTag' tagName = 'script' attributes { data-neos-node = ${q(node).property('_identifier')} src = ResourceUri { path = 'resource://TYPO3.Neos/Public/JavaScript/LastVisitedNode.js' } } } closingBodyTag = '' closingBodyTag.@position = 'end 100' closingHtmlTag = '