Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.
For the best experience please use the latest Chrome, Safari or Firefox browser.
Diese Präsentation bezieht sich auf Theme+ Version 3.
Die meisten Angaben sind jedoch ebenso für
Theme+ Version 2 gültig.
Diese Präsentation kann jederzeit online unter
www.themeplus.de angeschaut werden.
Diese Präsentation wurde auf der
Contao Konferenz 2012 vorgetragen.

Diese Präsentation von InfinitySoft steht unter einer Creative
Commons Namensnennung-Weitergabe unter gleichen Bedingungen 3.0 Deutschland Lizenz.
Diese Präsentation ist Teil des Online Angebots von
Alle Details finden Sie hier: www.infinitysoft.de/impressum.html
Diese Präsentation wurde ursprünglich mit impress.js erstellt und später auf jmpress.js portiert.
section {
background: #000;
padding: 20px;
border-radius: 10px;
article {
background: #fff;
.blue {
color: #00f;
}
}
}
Die Erweiterung phpless-extension erweitert die Funktion des phpless Compiler um automatisches hinzufügen von Browser Prefixen und fügt eine Hilfsfunktionen hinzu, z.B.:
.verlauf {
gradient: #000000 10% #ffffff 90%;
}
@media Block, wenn der Media-Query gesetzt wurde!system/scripts/!@media all!@media!@import wird nicht unterstützt!@font-face muss mit bedacht eingesetzt werden! (Stichwort: Media-Query)
{{include_theme_file::ID}}
Bindet die Datei mit der ID als externe Referenz ein (link/script Tag).
{{include_theme_file::path/to/file.css|js}}
Bindet die Datei path/to/file.css|js als externe Referenz ein (link/script Tag).
Ursprünglich in LAS:
{{insert_additional_sources::*}}
{{embed_theme_file::ID}}
Bettet die Datei mit der ID in die Seite ein (style/script Tag).
{{embed_theme_file::path/to/file.css|js}}
Bettet die Datei path/to/file.css|js in die Seite ein (style/script Tag).
Ursprünglich in LAS:
{{include_additional_sources::*}}
<?php
$objFile = new CssCode('body {
font-family: Verdana, sans;
}', 'BodyFont');
$GLOBALS['TL_CSS'][] = $objFile;
?>
Das funktioniert auch Analog mit den anderen Klassen (sie API für Entwickler).
$GLOBALS['TL_JAVASCRIPT_BODY'], JavaScripts die geziehlt im <body> anstatt im <head> eingefügt werden sollen.
<?php
$objFile = new LocalJavaScriptFile('tl_files/scripts/script.js');
$GLOBALS['TL_JAVASCRIPT_BODY'][] = $objFile;
?>
$GLOBALS['TL_JAVASCRIPT_CODE_BODY'], JavaScript Code der geziehlt im <body> anstatt im <head> eingefügt werden sollen.
<?php
$GLOBALS['TL_JAVASCRIPT_CODE_BODY'][] = 'alert("Happy new year?!");';
?>
Ladezeit von CSS und JavaScript Dateien ohne höhere Systemlast.
Contao 2.10+ setzt auf mod_deflate.
Benötigt Anpassung der .htaccess Datei.
##
# If you cannot use mod_deflate, uncomment the
# following lines to load a compressed .gz version
# of the bigger Contao JavaScript and CSS files.
##
AddEncoding gzip .gz
<FilesMatch "\.js\.gz$">
AddType "text/javascript" .gz
</FilesMatch>
<FilesMatch "\.css\.gz$">
AddType "text/css" .gz
</FilesMatch>
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME} \.(js|css)$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]
Ermöglicht den (nahezu) konfliktlosen Einsatz mehrerer Frameworks parallel.
(function($, $$){
// Original file content
})(document.id, document.search);
(function($) {
// Original file content
})(jQuery);
JavaScripts vom HEAD an das Ende der Seite verschieben.
Verhindert Blockieren des Seitenaufbaus beim laden der JavaScript Dateien.
<html>
<head>
…
<script src="script.js">
</script>
</head>
<body>
…
</body>
</html>
<html>
<head>
…
</head>
<body>
…
<script src="script.js">
</script>
</body>
</html>
JavaScripts werden asynchron nachgeladen.
Verhindert Blockieren des Seitenaufbaus beim ausführen der JavaScript Dateien.
abstract class LocalThemePlusFile
extends ThemePlusFile {
public function __construct($strFile);
public function getOriginFile();
public function getFile();
public function setAggregation($strAggregation);
public function getAggregation();
public function setAggregationScope($strAggregationScope);
public function getAggregationScope();
public function setTheme(Database_Result $objTheme);
public function getTheme();
public function isAggregateable();
public function setCc($strCc);
public function getCc();
public function getEmbeddedHtml($blnLazy = false);
public function getIncludeHtml($blnLazy = false);
}
class LocalCssFile
extends LocalThemePlusFile
implements CssFile {
public function setMedia($strMedia);
public function getMedia();
public function setAbsolutizePage($objAbsolutizePage);
public function getAbsolutizePage();
}
class LocalJavaScriptFile
extends LocalThemePlusFile
implements JavaScriptFile {
const JQUERY = 'jquery';
const MOOTOOLS = 'mootools';
public function setPosition($strPosition);
public function getPosition();
public function setFrameworkContext($strFrameworkContext);
public function getFrameworkContext();
}
abstract class ExternalThemePlusFile
extends ThemePlusFile {
public function __construct($strUrl);
public function getUrl()
public function setCc($strCc);
public function getCc();
public function getEmbeddedHtml($blnLazy = false);
public function getIncludeHtml($blnLazy = false);
}
class ExternalCssFile
extends ExternalThemePlusFile
implements CssFile {
public function setMedia($strMedia);
public function getMedia();
}
class ExternalJavaScriptFile
extends ExternalThemePlusFile
implements JavaScriptFile {
public function setPosition($strPosition);
public function getPosition();
}
class CssCode
extends LocalCssFile {
public function __construct($strCode, $strReference = 'undefined');
public function getCode();
}
class JavaScriptCode
extends LocalJavaScriptFile {
public function __construct($strCode, $strReference = 'undefined');
public function getCode();
}
abstract class FileAggregator
extends LocalThemePlusFile {
public function __construct();
}
class CssFileAggregator
extends FileAggregator {
public function add(LocalCssFile $objFile);
}
class JavaScriptFileAggregator
extends FileAggregator {
public function add(LocalJavaScriptFile $objFile);
}
$GLOBALS['TL_HOOKS']['generateFrameworkCss']Kann zum Generieren des Framework CSS Codes genutzt werden (Definition von linker/rechter Spalte).
<?php
$GLOBALS['TL_HOOKS']['generateFrameworkCss'][] =
array('MyClass', 'hookGenerateFrameworkCss');
class MyClass
{
public function hookGenerateFrameworkCss($objPage, $objLayout, $objPageRegular)
{
// generate a new css or return false
return false;
}
}
?>
$GLOBALS['TL_HOOKS']['renderVariable']Rendert eine Variable und gibt den Code zurück mit dem die Variable ersetzt wird.
<?php
$GLOBALS['TL_HOOKS']['renderVariable'][] =
array('MyClass', 'hookRenderVariable');
class MyClass
{
public function hookRenderVariable($arrRow, $strPath)
{
// generate a new code or return false
return false;
}
}
?>
$GLOBALS['TL_HOOKS']['replaceUndefinedVariable']Wird aufgerufen wenn eine Variable nicht gefunden wurde.
<?php
$GLOBALS['TL_HOOKS']['replaceUndefinedVariable'][] =
array('MyClass', 'hookReplaceUndefinedVariable');
class MyClass
{
public function hookReplaceUndefinedVariable($strName)
{
// return the missing variable content or false
return false;
}
}
?>
