My code is as follows:
content.tpl:
{* Smarty *} {extends file='PageContentLayout.tpl'}
PageContentLayout.tpl
{* Smarty *} {block name="file_name"} <p>{$smarty.current_dir}</p> <p>{$smarty.template}</p> {/block} {block name="other_content"} ... {* blah... *} ... {/block}
In earlier versions of smarty, this code printed the template name and file path: content.tpl .
However, I just upgraded to 3.1.29, and now it seems that this is the name of the main PageContentLayout.tpl file that is being printed.
I assume that this is a deliberate design change in different versions of Smarty, but I can not find documentation about these changes.
What would I really like to know, the best way to achieve the same functionality?
== EDIT ==
I noticed that even when calling {$smarty.current_dir} from an expanding file, we still get the path to the base file and the file name. This is a pretty significant change from earlier versions and quite serious in my case, because I can no longer write dynamic code to find the path to the top-level file.
source share