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 would print the template name and path of the file: content.tpl
.
However, I've just upgraded to 3.1.29, and it now seems that it's the name of the base file PageContentLayout.tpl
that is being printed.
I assume that this is a deliberate design change in different versions of Smarty, but I can't find any documentation on these changes.
What I'd really like to know though, is what the best way to achieving the former functionality is?
== EDIT ==
I've noticed that even when calling {$smarty.current_dir}
from the extending file, we still get the base-file's path and filename. This is quite a significant change from earlier versions, and quite serious in my case, because I can no longer write dynamic code to find the top-level file's path.