Prestashop - 1.4 デザインガイド

ページ / 26
 
{l s='My Text'} 
This will enable anyone to translate the theme into his own language, 
using the internal translation tool, which you can find in the PrestaShop 
back-office, under the "Tools" tab and its "Translation" sub-tab. In the 
"Modify translations" section, use the drop-down menu, choose "Front 
Office translation", then click on the flag of the language you wish to 
translate strings into. All the front-office strings will then be displayed. 
h3 Transmitting data to a PrestaShop theme 
The following graphic explains how data is transmitted from PrestaShop's 
core to its theme. Using the 
l()
 method enables the theme to display its 
text in the chosen language, if it has been translated beforehand. 
 
Best practices 
Here is a non-exhaustive list of best practices that you should follow when 
creating a theme: 
1.  Do not mix XHTML and PHP code. 
2.  Do not mix XHTML and CSS code; put the CSS code in a separate 
.css
 file. 
3.  Always validate your XHTML and CSS code using the W3C 
validators: 
. 
4.  Do not make SQL queries from a PHP controller ({{.php file at the 
root of PrestaShop); prefer the use of existing methods from the 
PrestaShop classes, or create new methods for these classes. 
5.  Always check if a method you need does not already exist in the 
available classes.