-
Notifications
You must be signed in to change notification settings - Fork 715
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
Foreach {$item@index} and {$item@iteration} not recognized in a included template #189
Comments
I think {foreach $last_articles as $item}
{$item@index}.{$item@iteration}.
{include 'site/inc/article_item.tpl'}
{/foreach} does work but {foreach $last_articles as $item}
{include 'site/inc/article_item.tpl'}
{/foreach} does not Foreach runtime optimization does remove code for properties not used. There is now a new attribute 'properties' which does force compilation of properties which might be used outside the current template scope. {foreach $last_articles as $item, properties=[index,iteration]}
{include 'site/inc/article_item.tpl'}
{/foreach} read NEW_FEATURES.txt The fix is now in the master branch |
… force compilation of loop properties see NEW_FEATURES.txt #189
If you add this (concerning current and outside scope template) to the new features text it is much clearer, IMHO. |
Foreach {$item@index} and {$item@iteration} not recognized in a included template:
Here, in the template article_item.tpl I want to use : {$item@index}.{$item@iteration}, but are not recognized. Data like: {$item.article_title}, {$item.article_text} is recognized.
I use smarty 3.1.30-dev/41
The text was updated successfully, but these errors were encountered: