Upload
jtl-software
View
270
Download
1
Embed Size (px)
Citation preview
template.xml
Basis-Informationen,
Template-Einstellungen,
Genutzte JS-Dateien, CSS
(Master-Template)
Template-Quelldateien finden
1. Element untersuchen im Browser
2. Suche im (Template-)Code:
Integrierte Entwicklungsumgebung
z.B. NetBeans, PHPStorm, Eclipse, Coda...
Oder hier: gitlab.jtl-software.de
Passende Variable finden
Debug-Plugin
Geladene Templatedateien
Variablen + Werte
Sessionvariablen
Alternativ: {$object|var_dump}
Warum ein Child-Template?
) Updatesicherheit * Getrennter Code
+ Smarty Blocks , Erweitern statt Kopieren
Wie erstelle ich ein Child-Template?
1. templates/{ChildTemplate}
2. template.xml: ...<Parent>Evo</Parent>...
3. Anzupassende Tpl-Dateien in entsprechenden Ordnern anlegen (am Parent-Template orientieren)
4. Erweitern à Smarty Blocks
Evo-Child-Example liefert Beispiele!
Code-Beispiel: Smarty Blocks: Prepend
templates/{ChildTemplate}/layout/footer.tpl:
{extends file="{$parent_template_path}/layout/footer.tpl"}
{block name=“footer-additional" prepend}
<div id=“all-payment-options" class="row footer-additional">
...
</div>
{/block}
Code-Beispiel: Smarty Blocks: Append
templates/{ChildTemplate}/layout/header.tpl:
{extends file="{$parent_template_path}/layout/header.tpl"}
{block name="head-title" append} – günstig bei JTL{/block}
Code-Beispiel: Smarty Blocks: Replace
templates/{ChildTemplate}/layout/header.tpl:
{extends file="{$parent_template_path}/layout/header.tpl"}
{block name=“logo"}
<canvas id="canvas-logo"></canvas>
{/block}
Vorhandenes Theme kopieren
template.xml anpassen (Theme registrieren)
less/variables.less und less/theme.less anpassen
bootstrap.css kompilieren
Theme im Child-Template
.
/
%
0
bootstrap.css kompilieren
Evo-Editor-Plugin nutzen
theme/{mytheme} muss beschreibbar sein!
Alternativ - Konsolenbefehl:
php includes/plugins/evo_editor/version/100/adminmenu/cli.php mytheme
LiveStyler
(Im Evo-Editor-Plugin enthalten, aktivieren in TPL-Einstellungen)
Nicht für Produktivshops!
Muss ich immer erst kompilieren, um CSS-Änderungen zu sehen?
Errorlogging aktivieren
includes/config.JTL-Shop.ini.php
// loglevel - smarty templates
define('SMARTY_LOG_LEVEL', E_ALL);
// display errors
ini_set('display_errors', 1);
Fehlerausgabe interpretieren
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template
"htdocs/shop4_dev/templates/Evo/productdetails/details.tpl" on line
83 "<div class="rating-wrapper{hallo} col-xs-4 text-right" unknown
tag "hallo" <-- thrown in
/htdocs/shop4_dev/includes/vendor/smarty/smarty/libs/sysplugins/sma
rty_internal_templatecompilerbase.php on line 83
Fehlerausgabe interpretieren
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template
"htdocs/shop4_dev/templates/Evo/productdetails/details.tpl" on line
83 "<div class="rating-wrapper{hallo} col-xs-4 text-right" unknown
tag "hallo" <-- thrown in
/htdocs/shop4_dev/includes/vendor/smarty/smarty/libs/sysplugins/sma
rty_internal_templatecompilerbase.phpon line 83