Jump to content

Module directly in tpl file?


Recommended Posts

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


{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


{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 1095

What is wrong?
Link to comment
Share on other sites


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 1095
What is wrong?


Yes, you're right. After test and read Smarty doumentaction you have to set absolute path
Something like this:
{include file=/home/qrczak/public_html/prestashop/modules/blocksearch/blocksearch.tpl}



And it works for me

Regards

Link to comment
Share on other sites

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

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

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

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

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

  • 4 weeks later...

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