Child pages
  • Podstawy rozwoju szablonu

Versions Compared

Key

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

...

Architektura 3 - warstwowa ma wiele zalet:

  • Jest to łatwiejsze do odczytania Ułatwia odczytanie kodu.
  • Programiści mogą dodawać i edytować kod szybciej.
  • Graficy i  integratorzy HTML mogą pracowć z zakresem powierzonych folderów /themes folder without having to understand or even read a single line of PHP code bez odczytania czy zrozumienia choćby jednej linijki kodu PHP.
  • Programiści mogą pracować na dodatkowych danych i modułach, które mogą wykorzystać integratorzy HTMLDevelopersHTML.

 

Info

Jest to ta sama zasada jak  w Model-View-Controller (MVC) architektury, tylko jest to prostrzy i bardziej przystepny sposób.
Dowiedz się więcej na temat MVC w Wikipedii: http://en.wikipedia.org/wiki/Model-view-controller

...

Widok jest interfejsem użytkownika z którym użytkownik wchodz wchodzi w interakcje.

Jego pierwszym zadaniem jest wyświetlanie danych, które są udzielane przez model. Jego druga rola służy do obsługi wszystkich działań ze strony użytkownika (kliknięcia myszą, wyboru elementów, przyciski, etc.), a także wysyłać wysyła te zdarzenia do kontrolera. 

Widok nie robi żadnego przetwarzaniaprzetwarza, tylko wyświetla widok przetwarzania wykonywanego przez model i komunikuje się z użytkownikiem.

Controller

The Controller manages synchronization events between the Model and the View, and updates both as needed. It receives all the user events and triggers the actions to perform.

If an action needs data to be changed, the Controller will "ask" the Model to change the data, and in turn the Model will notify the View that the data has been changed, so that the View can update itself.

How a theme works

A PrestaShop theme is a set of files which you can edit in order to change the look of your online shop.

Here are a few important tidbits:

...

Kontroler

Kontroler ma za zadanie synchronizować zdarzenia pomiędzy Modelem a Widokiem i aktualizować obydwa jeśli jest taka potrzeba. Otrzymuje on wszystkie zdarzenia użytkownika i inicjuje potrzebne czynności do wykonania.

Jeśli jest potrzeba zmian danych, Kontroler zapyta Model w celu zmiany danych, a Model z kolei powiadomi, że dane zostały zmienione, tak aby widok mógł się aktualizować samoczynnie.

Jak działa templatka

Templatka PrestaShop to zestaw plików które można edytować w celu zmiany wyglądu sklepu internetowego.

Oto kilka ważnych ciekawostek:

  • Wszystkie motywy i pliki mają swoje lokalizacje w folderze  /themes.
  • Każdy z motywów ma swój własny sub-folder w folderze głównym motywów.
  • Każdy z motywów jest wykonany z pliku szablonów (.tpl), pliku obrazów (.gif, .jpg, .png), one or more CSS files z jednego lub więcej plików CSS (.css), and sometimes even JavaScript files i czasami także z plików JavaScript (.js).
  • Each theme has a Każdy z motywów ma podgląd 180*200 preview.jpg image file in its folder, enabling the shop-owner to see what the theme looks like directly from the back office, and select the theme appropriately.

Theme-specific folders

As a theme developer, there are mostly 5 PrestaShop folders you must be aware of:

  • /modules: this is where all the modules are located. A module has templates files, can also redefine theme parts.
  • /themes: this is where all the themes are located. The default 1.5 theme is in the /default folder (in 1.4, it was   pliku w folderze umożliwiając właścicielowi sklepu zobaczenie wyglądu sklepu bezpośrednio z panelu adminstracyjnego, a następnie wybór odpowiedniego motywu.

Specyficzne foldery motywu

Trzeba być świadomym, że istnieje 5 głównych folderów PrestaShop:

  • /modules: to gdzie moduły są zlokalizowane. Moduł zawiera pliki szablonów, które mogą być w części tematycznej przedefiniowane.
  • /themes: jest miejscem gdzie wszystkie motywy są zlokalizowane. Domyślny 1.5 motyw jest w folderze /default (w 1.4, był w /prestashop).
  • /mails: this is where all the e-mail templates are located. E-mail templates should ideally reflect the style and design of the main theme. Each sub-folder contains language-specific templates
  • /img: this is where all the store's images are located. Theme-specific images are stored in the theme's own /img folder.
  • /pdf: this is where all the document models are located.

General information

How a theme works

A PrestaShop theme is a set of files which you can edit in order to change the look of your online shop.

...

  • All themes have their files located in the /themes root folder.
  • Each theme has its own sub-folder, in the main themes folder.
  • Each theme is made of template files (.tpl), image files (.gif, .jpg, .png), one or more CSS files (.css), and sometimes even JavaScript files (.js).
  • Each theme has a 180*200 preview.jpg image file in its folder, enabling the shop-owner to see what the theme looks like directly from the back office, and select the theme appropriately.

Theme-specific folders

As a theme developer, there are mostly 5 root folders you must be aware of:

...