Jump to content

Error: unknown tag “l” in smarty template


Recommended Posts

We are developing a module in prestashop. At a place, we need to define new smarty object to create and fetch new template. This is working fine but when we using language variable in that custom smarty template then its giving us error for unknown tag "l" in tpl file. Below is the error which is we are getting:

 

Uncaught --> Smarty Compiler: Syntax error in template "/var/www/html/prestashop/modules/mymodule/views/templates/front/product/informations.tpl" on line 12 "<span class="kblabel ">{l s='Name' mod='mymodule'}</span><em>*</em>" unknown tag "l" <-- thrown in /var/www/html/prestashop/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 12

 

We have posted the same issue on stackoverflow.com.

 

You can check the issue directly by going to below link:

 

http://stackoverflow.com/questions/31990153/unknown-tag-l-in-smarty-prestashop?noredirect=1#comment51903552_31990153

 

I have searched lot of things on blogs, forum but nothing got. And really can't able to find the solution to fix this error. Please anyone look into my issue and let me share the resolution for this error. 

 

Thanks in advance.

  • Like 1
Link to comment
Share on other sites

I have tried to upload the requested file but i dont have permission. So, I am posting the information.tpl content below, in this reply:

 

 

<div class="kb-panel outer-border">
    <div class='kb-panel-header'>
        <h1>{$form_title|escape:'html':'UTF-8'}</h1>
        <div data-toggle="kb-product-form-information" class='kb-accordian-symbol kbexpand'></div>
        <div class='clearfix'></div>
    </div>
    <div id="kb-product-form-information" class='kb-panel-body'>
        <div class="kb-block kb-form">
            <ul class="kb-form-list">
                <li class="kb-form-l">
                    <div class="kb-form-label-block">
                        <span class="kblabel ">{l s='Name' mod='mymodule'}</span><em>*</em>
                    </div>
                    <div class="kb-form-field-block">
                        <input type="text" class="kb-inpfield required" validate="isGenericName" name="name_{$default_lang|intval}" value="{$name|escape:'html':'UTF-8'}" />
                    </div>
                </li>
                <li class="kb-form-r">
                    <div class="kb-form-label-block">
                        <span class="kblabel ">{l s='Reference Code' mod='mymodule'}</span>
                    </div>
                    <div class="kb-form-field-block">
                        <input type="text" class="kb-inpfield  required" validate="isGenericName" name="reference" value="{$reference|escape:'html':'UTF-8'}" />
                    </div>
                </li>
            </ul>
        </div>
    </div>
</div>
Link to comment
Share on other sites

  • 1 year later...

Got same error, my code:

$smarty = new Smarty();
$smarty->assign(array(
    'list_class'        => $list_class,
    'last'              => (int)$last,
    'start'             => (int)$start,
    'end'               => (int)$end,
    'page'              => $page,
    'page_minus'        => $page_minus,
    'page_plus'         => $page_plus,
    'limit'             => (int)$limit,
    'link'              => $link,
    'token'             => $token,
));

$html = $smarty->fetch(_PS_MODULE_DIR_.$this->name.'/views/templates/front/pagination.tpl');
return $html;
I use this in my module class. I have module controller that require class, in class i use this code.
Link to comment
Share on other sites

hey Kerm 

 

if you got same error shouldnt you show us that pagination.tpl file as error must be there.

Also do check in debug mode exact error message, could be a clue.

 

Hey, i already fix this issue, like that:

$this->context = Context::getContext();
$smarty = $this->context->smarty;

And also never assign variable $link in your template... because this variable already in used in core.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...