Jump to content

The best way to to use partials inside a layout.


Recommended Posts

Hello everyone,
So I'm quite new to PrestaShop theme development, and now I'm trying to understand what is the best way to include and use partials in a layout.

So here's the problem: I have a file: themes\classic\templates\layouts\layout-both-columns.tpl
And here's the code part that concerns me:

<html lang="{$language.iso_code}" class="no-js">
  <head>
    {block name='head'}
      {include file='_partials/head.tpl'}
    {/block}
  </head>

I'm a little confused if the way I'm doing is fine. Should the <head></head> tags be inside _partials/head.tpl file? Or it is fine as it is now?
Since I'm just getting started for me it's kinda hard to understand what parts of the code should be there, for example the same thing would probably apply to a footer. Are there any recommendations how to do it properly, so the code is organized and not duplicated.
Of course the head is like one unique element that won't be included twice, but I'm stil lnot sure if I should keep it inside a partials file or inside a layout.

Any suggestions, recommendations are really appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...