Administrative Panel In Prestashop (Part III)

Administrative Panel In Prestashop (Part III)

Every Prestashop store owner works with a back-office daily. In 1.5 version it became very user-friendly and easy to use. But how exactly does it work? This article is about initialization, files location and main templates of Presta admin panel.

1. Initialization in a controller

In a controller we are accustomed to see the code that is similar to this:

Let’s demonstrate and explain the code of the AdminCоntrоller: :display() method:

Most controllers in the admin panel are generated either by using the class Helper or its derivatives. In the classes/helper folder you can find the following classes:

  • Helper
  • HelperForm
  • HelperHelpAccess
  • HelperList
  • HelperOptions
  • HelperView

It is rather easy and convenient to use helpers. For example, you can get the whole list of modules in this way:

To generate a form you can use this code:

2. Files location

Admin theme files are located under the following path: your_admin/themes/default/template

In this example default – this is the name of a theme.

If in your module you are using your own tpl files, it is better to place them under this path: modules/your_module/ views/templates /front (admin), this way you will retain compatibility with the paths in the method Helper::createTemplate($tpl_name):

3. Main templates

  • your_admin/themes/default/template/layout.tpl – this template can be loaded on all pages as it contains header.tpl, the list of warnings, notification, the body of the page and footer.tpl
  • your_admin/themes/default/template/header.tpl
  • your_admin/themes/default/template/ footer.tpl
  • your_admin/themes/default/template/helpers/form/form.tpl – uses all forms that are generated by the helper class
  • your_admin/themes/default/template/ controllers/* – contains templates for admin controllers.


Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *