hi
i have a modul which uses smarty
i didnt include a new smarty class in my file because cmsms use smarty
but i want to use my smarty templates
i put this row in my php
$smarty->display("./templates/x.tpl");
but the cmsms said
Warning: Smarty error: unable to read resource: "./templates/x.tpl" in /www/http/mps/soft/webmps/wmps2_test/lib/smarty/Smarty.class.php on line 1095
so where i must put my templates?
or to solve this problem
thanks
place of smarty templates?
Re: place of smarty templates?
Try in [CMSMS_ROOT]/tmp/templatespumuklee wrote: hi
i have a modul which uses smarty
i didnt include a new smarty class in my file because cmsms use smarty
but i want to use my smarty templates
i put this row in my php
$smarty->display("./templates/x.tpl");
but the cmsms said
Warning: Smarty error: unable to read resource: "./templates/x.tpl" in /www/http/mps/soft/webmps/wmps2_test/lib/smarty/Smarty.class.php on line 1095
so where i must put my templates?
or to solve this problem
Alby
Re: place of smarty templates?
Have you tried /modules/your_module/templates ?pumuklee wrote: so where i must put my templates?
Re: place of smarty templates?
Put the templates inside a 'templates' folder in your module directory and use the ProcessTemplate method:pumuklee wrote: $smarty->display("./templates/x.tpl");
Code: Select all
$this->ProcessTemplate('xt.pl');
D
Re: place of smarty templates?
i found the solution
im not started well with smarty module
i write $smarty = new Smarty;
instead
$smarty = new Smarty_CMS($config);
$config array contain all the config data
and from there goes
ok my template path is set in my script to point to my_module/templates
thanks for the help
im not started well with smarty module
i write $smarty = new Smarty;
instead
$smarty = new Smarty_CMS($config);
$config array contain all the config data
and from there goes
ok my template path is set in my script to point to my_module/templates
thanks for the help
Re: place of smarty templates?
As I explained above you don't need to create a new Smarty object.
Your module has a ProcessTemplate method, which looks in your_module/templates automatically.
There are also several methods available to use templates from the database instead of from a file, so you can make the template editable from the admin area.
Regards,
D
Your module has a ProcessTemplate method, which looks in your_module/templates automatically.
There are also several methods available to use templates from the database instead of from a file, so you can make the template editable from the admin area.
Regards,
D