-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$smarty.block.parent doesn't work in 3.1.27 and HEAD #68
Comments
Can you provide an example? I can't reproduce it right now |
Yes of course!
<html>
<head>
</head>
<body>
{block name="header"}
header
{/block}
{block name="content"}
{/block}
{block name="footer"}
footer
{/block}
</body>
</html>
{extends file="layout.html"}
{block name="content"}
{block name="module-content"}
content
{/block}
{/block}
{extends file="module.html"}
{block name="header"}
<p style="text-align:center">header-grandchild1</p>
{$smarty.block.parent}
<p style="text-align:center">header-grandchild2</p>
{/block}
{block name="module-content"}
<p style="text-align:center">content-grandchild1</p>
{$smarty.block.parent}
<p style="text-align:center">content-grandchild2</p>
{/block}
{block name="footer"}
<p style="text-align:center">footer-grandchild1</p>
{$smarty.block.parent}
<p style="text-align:center">footer-grandchild2</p>
{/block} In header you will see:
In footer you will see:
But in module-content you will see:
Expected result by me was:
|
Your example does not output 'header' and 'footer' but anyway the {$smarty.block.parent} does reference the the content block in layout.html. That is really not very help full. |
Yes, I missed header and footer content in layout.html file, so I fixed it before the moment. |
- bugfix {$smarty.block.parent} did always reference the root parent block #68
- bugfix {$smarty.block.parent} did always reference the root parent block #68
Your problem is now fixed in the master branch. |
Merge release-2.0.7.2 into release-2.0.8 branch
As in summary. I tried to insert {$smarty.block.parent} in block modified by child template but without effect.
Btw. http://www.smarty.net/docs/en/language.function.block.tpl contains inproper examples of prepend and append flag usage. These flags are used in reversed meaning.
The text was updated successfully, but these errors were encountered: