...
Code Block | ||||
---|---|---|---|---|
| ||||
<div class="pagenotfound"> <div class="img-404"> <img src="{$img_dir}/img-404.jpg" alt="{l s='Page not found'}" /> </div> <h1>{l s='This page is not available'}</h1> <p> {l s='We\'re sorry, but the Web address you\'ve entered is no longer available.'} </p> <h3>{l s='To find a product, please type its name in the field below.'}</h3> <form action="{$link->getPageLink('search')|escape:'html':'UTF-8'}" method="post" class="std"> <fieldset> <div> <label for="search_query">{l s='Search our product catalog:'}</label> <input id="search_query" name="search_query" type="text" class="form-control grey" /> <button type="submit" name="Submit" value="OK" class="btn btn-default button button-small"> <span>{l s='Ok'}</span> </button> </div> </fieldset> </form> <div class="buttons"> <a class="btn btn-default button button-medium" href="{$base_dir}" title="{l s='Home'}"> <span><i class="icon-chevron-left left"></i>{l s='Home page'}</span> </a> </div> </div> |
The template engine uses \ {...} to handle instructions. The rest of the document is sent to the browser as is.
It is possible to use a template to generate HTML files, and also XML files, text files, etc.
The PDF files
The PDF files are also generated from Smarty templates (.tpl
files). The main difference with the template files used to generate HTML, is that the PDF templates do not allow for external resources such as CSS. Therefore you must use inline styling in order to change the style of your invoice, order slip, return slip, etc. A default PrestaShop installation comes with two style templates: delivery-slip.style-tab.tpl
and invoice.style-tab.tpl
. You can find these in the folder /pdf/. The following table shows how the style tabs are linked:
PDF Template | Style tab |
---|---|
Delivery slip | delivery-slip.style-tab.tpl |
Supply order | invoice.style-tab.tpl |
Order return | invoice.style-tab.tpl |
Invoice | invoice.style-tab.tpl |
Order slip | invoice.style-tab.tpl |
Note that if you would like to apply a different style template, you will have to override the corresponding PDF Class in the directory /classes/pdf/
.
Scratching that itch: creating all files from zero
...