﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking
2419	Templates weitgehend update-sicher machen	noRiddle	somebody	"Könnte man nicht die Arbeit bei Updates bezogen auf das Template sehr vereinfachen indem man Folgendes einbaut ?
(am Beispiel ''tpl_modified_responsive'')
- ''/templates/tpl_modified_responsive/'' ist der Standard-Ordner
- ein weiteres Verzeichnis anlegen namens ''/templates/custom/''

Bei Bestimmung des Files für das Template schaut man ob es das File im zweitgenannten Ordner gibt und wenn nicht nimmt man das Original im erstgenannten Ordner.
Damit könnte man bei einem Update alle Template-Files im Original-Ordner drüberbügeln und müsste lediglich die Files im custom-Ordner bearbeiten.

Am Beispiel /includes/modules/product_info.php:
Statt
{{{
$product_info = $info_smarty->fetch(CURRENT_TEMPLATE.'/module/product_info/'.$product->data['product_template']);
}}}

das
{{{
$product_info = is_file(DIR_FS_CATALOG.'templates/custom/module/product_info/'.$product->data['product_template']) ? $info_smarty->fetch(DIR_FS_CATALOG.'templates/custom/module/product_info/'.$product->data['product_template']) : $info_smarty->fetch(CURRENT_TEMPLATE.'/module/product_info/'.$product->data['product_template']);
}}}



Mittels meines notepad++ habe ich das folgendermaßen mit einem Schlag für alle Files umsetzen können:
- Suchmodus ""Reguläre Ausdrücke""
- Suchen nach: {{{\$([a-z_]*)smarty->fetch\(CURRENT_TEMPLATE\.'(.*)\);}}}
- Ersetzen durch: {{{is_file\(DIR_FS_CATALOG.'templates/custom\2\) ? \$\1smarty->fetch\(DIR_FS_CATALOG.'templates/custom\2\) : \$\1smarty->fetch\(CURRENT_TEMPLATE\.'\2\);}}}
- Button ""Alle ersetzen"" klicken


Das geht natürlich entsprechend für {{{smarty->display(}}}.

"	Neues Feature	new	normal	modified-shop-2.0.9.0	Shop	2.0.7.2					
