Prestashop - 1.4 Guide de l'utilisateur Page 19

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 36
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 18
Displaying content
Now that we have access to the left column, we should display something
there.
As said earlier, the content to be displayed in the theme should be stored
in .tpl files. We will create the mymodule.tpl file, which was passed as a
parameter of the display() method in our module's code.
So, let's create the mymodule.tpl file, and add some lines of code to it.
mymodule.tpl
<!-- Block mymodule -->
<div id="mymodule_block_left" class="block">
<h4>Welcome!</h4>
<div class="block_content">
<ul>
<li><a href="{$base_dir}modules/mymodule/mymodule_page.php"
title="Click this link">Click me!</a></li>
</ul>
</div>
</div>
<!-- /Block mymodule -->
Save the file in the module's root folder, reload your shop's homepage: it
should appear on top of the left column, right below the shop's logo.
The displayed link doesn't lead anywhere for now. If you need to test it,
add the needed mymodule_page.php file in the module's folder, with a
minimal content, such as "Welcome to my shop!" The resulting page will
be very raw, so let's see if we can use the theme's style instead.
As you would expect, we have to create a TPL file in order to use the
theme's style. Let's create the mymodule_page.tpl file, which will contain the
Vue de la page 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 35 36

Commentaires sur ces manuels

Pas de commentaire