I have a Smarty (version 3.1.21) template like this:
<div>
{include file='includes/test.tpl'}
{pagebuilder data=$data.top_description}
</div>
includes/test.tpl content is:
{function name=pagebuilder}
{foreach $data as $row}
...
{/foreach}
{/function}
Error message is:
Syntax error in template "/home/master/projet/public/templates/controllers/pagebuilder-preview.tpl" on line 29 "{pagebuilder data=$data.Content}" unknown tag "pagebuilder"
How to ommit unknown tag error after include file and properly use function from included template?
External defined template functions must be called with the {call} tag.
So your base template should be rewrited into:
<div>
{include file='includes/test.tpl'}
# {pagebuilder data=$data.top_description}
{call name=pagebuilder data=$data.top_description}
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With