qrczak Posted January 21, 2009 Share Posted January 21, 2009 Is it possible to put any module directly into tpl file (not through hooks)?something like: include('blockcart'); Link to comment Share on other sites More sharing options...
disarci Posted January 21, 2009 Share Posted January 21, 2009 Hi,yes:http://www.smarty.net/manual/en/language.function.include.phpyou have many examples in original templates:{include file=$tpl_dir./breadcrumb.tpl} Link to comment Share on other sites More sharing options...
qrczak Posted January 21, 2009 Author Share Posted January 21, 2009 Big thanks!But it's working only with tpl files from /themes/myTheme/ directory. What if I want include for example: search or currencies?In my (and default) theme directory there no currencies.tpl file only in modules/blockcurrencies/blockcurrencies.tpl but {include file=modules/blockcurrencies/blockcurrencies.tpl} not working.Do you know solution for this?regards Link to comment Share on other sites More sharing options...
qrczak Posted January 21, 2009 Author Share Posted January 21, 2009 OK, I figured out this.Next question: $tpl_dir. - it's give for us path to actual theme folder, is there any variable which give me path to modules folder?regards Link to comment Share on other sites More sharing options...
disarci Posted January 22, 2009 Share Posted January 22, 2009 Sorry,I could not find,you have to use the base path and build it:{$base_dir_ssl} {include file={$base_dir_ssl}modules/blockcurrencies/blockcurrencies.tpl} Link to comment Share on other sites More sharing options...
voxdizainas Posted January 26, 2009 Share Posted January 26, 2009 And I can copy from module directory to theme directory tpl file ant add to example to header custom module{include file=$tpl_dir./blockcurrencies.tpl} I am correct?{$base_dir_ssl} where this tag exist? In config or seting? I dont find this ... Link to comment Share on other sites More sharing options...
qrczak Posted January 26, 2009 Author Share Posted January 26, 2009 {include file=$tpl_dir./blockcurrencies.tpl} This example insert tpl file from active theme folder but if you want insert template form any modules try{include file=$modules_dir./nameofmodule/nameofmodule.tpl} {$base_dir_ssl} where this tag exist? In config or seting? I dont find this ... init.php (line #99) - in root directory Link to comment Share on other sites More sharing options...
Guest Posted January 26, 2009 Share Posted January 26, 2009 If it could help, kindly download the Smarty Cheat Sheet : http://download.prestaflux.com/file.php?id=2 Link to comment Share on other sites More sharing options...
voxdizainas Posted January 26, 2009 Share Posted January 26, 2009 {include file=$tpl_dir./blockcurrencies.tpl} This example insert tpl file from active theme folder but if you want insert template form any modules try{include file=$modules_dir./nameofmodule/nameofmodule.tpl} {$base_dir_ssl} where this tag exist? In config or seting? I dont find this ... init.php (line #99) - in root directory Ok but i have error {include file=$modules_dir./blockbestsellers/blockbestsellers.tpl}Warning: Smarty error: unable to read resource: "/modules/./blockbestsellers/blockbestsellers.tpl" in /public_html/tools/smarty/Smarty.class.php on line 1095What is wrong? Link to comment Share on other sites More sharing options...
voxdizainas Posted January 26, 2009 Share Posted January 26, 2009 If it could help, kindly download the Smarty Cheat Sheet : http://download.prestaflux.com/file.php?id=2 Thanks realy helps this Link to comment Share on other sites More sharing options...
qrczak Posted January 26, 2009 Author Share Posted January 26, 2009 Ok but i have error {include file=$modules_dir./blockbestsellers/blockbestsellers.tpl}Warning: Smarty error: unable to read resource: "/modules/./blockbestsellers/blockbestsellers.tpl" in /public_html/tools/smarty/Smarty.class.php on line 1095What is wrong? Yes, you're right. After test and read Smarty doumentaction you have to set absolute pathSomething like this:{include file=/home/qrczak/public_html/prestashop/modules/blocksearch/blocksearch.tpl} And it works for meRegards Link to comment Share on other sites More sharing options...
voxdizainas Posted January 26, 2009 Share Posted January 26, 2009 yep this work, but make in theme full path to server root is not corect... I try make copy from modules template file and insert tag {include file=$tpl_dir./templatename.tpl} Link to comment Share on other sites More sharing options...
qrczak Posted January 26, 2009 Author Share Posted January 26, 2009 yep this work, but make in theme full path to server root is not corect... I try make copy from modules template file and insert tag {include file=$tpl_dir./templatename.tpl} I read somewhere if you overwrite the tpl file from some folder in modules/ you can make in your theme folder folder modules and subfolder with module and there copy tpl file and try:{include file=$tpl_dir./modules/blocksearch/blocksearch.tpl} Link to comment Share on other sites More sharing options...
qrczak Posted January 26, 2009 Author Share Posted January 26, 2009 yep this work, but make in theme full path to server root is not corect... You absolutly right, becouse if you make this theme for you it's doesn't matter but if you want, for example, sell this theme it's problem becouse you don't know absolute path of your future client server. Link to comment Share on other sites More sharing options...
voxdizainas Posted January 26, 2009 Share Posted January 26, 2009 yep this work, but make in theme full path to server root is not corect... I try make copy from modules template file and insert tag {include file=$tpl_dir./templatename.tpl} I read somewhere if you overwrite the tpl file from some folder in modules/ you can make in your theme folder folder modules and subfolder with module and there copy tpl file and try:{include file=$tpl_dir./modules/blocksearch/blocksearch.tpl} yep this solution for me ,thanks man for help Link to comment Share on other sites More sharing options...
voxdizainas Posted January 26, 2009 Share Posted January 26, 2009 yep this work, but make in theme full path to server root is not corect... You absolutly right, becouse if you make this theme for you it's doesn't matter but if you want, for example, sell this theme it's problem becouse you don't know absolute path of your future client server. And if you go to diferent server and in new server maybe path not example like in older. If make full path you evry time make change in theme but if make with file=$tpl_dir. just copy directory Link to comment Share on other sites More sharing options...
qrczak Posted January 26, 2009 Author Share Posted January 26, 2009 And if you go to diferent server and in new server maybe path not example like in older. If make full path you evry time make change in theme but if make with file=$tpl_dir. just copy directory Yes, right. But unfortunately we can't overwrite the php files from modules folders. :-( Sometimes it will helpful. Link to comment Share on other sites More sharing options...
sperio Posted February 23, 2009 Share Posted February 23, 2009 check out the definitions in init.php&config.inc.phpthe calls made in your tpl are defined in init.php which reference the main calls in config.inc.phpso there are now enough info to muck around cheersalfred Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now