Jump to content

Smarty directory variable is empty


Recommended Posts

I can't seem to find my issue.  On my test.tpl page I only have


And it appear to be empty.


However this block of code works just fine.


{if $coffee == 'good'}

Am i missing something to use these variables?

$img_ps_dir //URL for the PrestaShop image folder.
$img_cat_dir //URL for the categories images folder.
$img_lang_dir //URL for the languages images folder.
$img_prod_dir //URL for the products images folder.
$img_manu_dir //URL for the manufacturers images folder.
$img_sup_dir //URL for the suppliers images folder.
$img_ship_dir //URL for the carriers (shipping) images folder.
$img_dir //URL for the theme’s images folder.
$css_dir //URL for the theme’s CSS folder.
$js_dir //URL for the theme’s JavaScript folder.
$tpl_dir //URL for the current theme’s folder.
$modules_dir //URL the modules folder.
$mail_dir //URL for the mail templates folder.
$pic_dir //URL for the pictures upload folder

Link to comment
Share on other sites

The $tpl_dir is defined in classes/controller/FrontController.php, so if your tpl is called through the front controller or any of it's extended classes (i.e. all controllers for the front end of your shop...) , it should be known.


How do you get to your tpl file?



Link to comment
Share on other sites

Currently this is only a admin configure page.  But I use

return $this->display(__FILE__, 'settings.tpl');


To call the page in the "function getContent()".


Is there anyway to get these using the administration area?

Edited by wstar (see edit history)
Link to comment
Share on other sites

Well in not called through a controller, you could always add the smarty variable yourself, just before the call to tpl file:


    'tpl_dir' => _PS_THEME_DIR_,



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