Jump to content

Template functions (Smarty) reference guide


Recommended Posts

Hello.

 

(if you don't what to annoy yourself reading noob things, please go forward to bold red text :P )

 

I'm new on PS template things. I would like to modify a template, so I was investigating about that. I see that in tpl files, we can find code like this:

 

{if $category->description}
<div class="cat_desc">{$category->description}</div>
{/if}

 

or this

 

{if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if}
{$nb_products}
{if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}

 

Ok... I was searching on google and this forum and all info I can got is that Prestashop is using a template engine called Smarty, that simplifies the template things. All I see is a pseudo-php code, for example I can print the current category description just adding {$category->description}, or I can do a foreach of subcategories just writting {foreach from=$subcategories item=subcategory} .... {/foreach}.

 

My question is: Where can I found documentation about functions supported in templates? Is there any CHM or Guide with all functions, data that I can obtain, etc? I got Smarty functions reference, so I know how to if, foreach, for, etc, but I don't know where can I get information or documentation about prestashop values that I can use, for example... how can I check it a file exist??

 

Thank you in advance for your help.

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...