Child pages
  • Theme development fundamentals

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PrestaShop's templating system enables web-designers and developers to easily build their own theme, provided they have a solid technical grounding.

This The templating system is based on a 3-tier architecture:

...

Smarty 2 has long been deprecated, and should not be used for PrestaShop 1.6 themes.

Bootstrap v3

Since version 1.6, PrestaShop includes the Bootstrap front-end framework (http://getbootstrap.com/). It is a collection of HTML and CSS tools built to help web designer create consistently beautiful and responsive designs (meaning that they can easily adapt to any screen size). Initially an internal effort to document and share common design patterns and assets within the Twitter company, it has quickly grown to become the most used front-end framework.

...

Info

Designers creating a new back-office theme MUST use Bootstrap.

Designers creating a new front-office theme CAN SHOULD use Bootstrap, but . While this is currently not an obligation, Bootstrap is deeply built into PrestaShop.

Bootstrap initially uses the LESS dynamic stylesheet language (http://lesscss.org/), but PrestaShop uses the Bootstrap For Sass port (https://github.com/twbs/bootstrap-sass), Sass being the language that inspired LESS. This makes it possible to use the Compass framework.

...

  1. Do not mix HTML and PHP code; use Smarty tags in order to get a dynamic page.
  2. Do not mix HTML and CSS code; put the CSS code in a separate .css file.
  3. Always validate your HTML and CSS code using the W3C validators: http://validator.w3.org/ for HTML and XHTML, http://jigsaw.w3.org/css-validator/ for CSS.
  4. Do not make SQL queries from a PHP controller (.php file at the root of PrestaShop); use the existing methods from the PrestaShop classes, or create new methods for these classes.
  5. Always check if a method you need already exists in the available classes.
  6. Do not ever edit PrestaShop's own files; always build your code into modules in order to facilitate updates.
  7. Make sure to always produce a clear and readable code, making it easy to maintain that code for anyone in the foreseeable future.
  8. Do comment your code, and write both method names and comments in plain English.
  9. When editing the theme on a production site, always put the shop in Maintenance Mode first, via the back-office' "Maintenance" preference page.
  10. Use modern browsers, such as Firefox (latest non-beta version), Google Chrome (latest non-beta version), IE10+ or Opera (latest non-beta version) – and make sure your friends and family members do too!
  11. Whenever possible, use CSS sprites (read http://www.alistapart.com/articles/sprites and http://www.alistapart.com/articles/sprites2/).
  12. Disable your browser's cache when developing.