Jump to content

module -> error when extending template


Bernard8A

Recommended Posts

When attempting to apply template to a module page I am getting the following error:

Note that this will work fine, ie the content will print to the screen correctly, if I do not attempt to extend the layout.

Thanks

Quote

FatalThrowableError in smarty.config.inc.php line 188: Type error: Argument 1 passed to smartyClassnames() must be of the type array, null given, called in /Users/user/Sites/presta1/classes/Smarty/SmartyLazyRegister.php on line 83

The template causing this error has the full path as modules/mymodcomments/views/templates/front/list.tpl

{extends file=$layout}
{block name='content'}
    {block name='page_content_container'}
        {block name='page_header_container'}
        <h1>
            {l s='Comments on product' mod='mymodcomments'}
        	"{$product->name}"
        </h1>
        {/block}

        <div class="rte">
        {foreach from=$comments item=comment}
        	<div class="mymodcomments-comment">
        		<img src="http://www.gravatar.com/avatar/{$comment.email|trim|strtolower|md5}?s=45" class="pull-left img-thumbnail mymodcomments-avatar" />
        		<div>{$comment.firstname} {$comment.lastname|substr:0:1}. <small>{$comment.date_add|substr:0:10}</small></div>
        		<div class="star-rating"><i class="glyphicon glyphicon-star"></i> <strong>{l s='Grade:' mod='mymodcomments'}</strong></div> <input value="{$comment.grade}" type="number" class="rating" min="0" max="5" step="1" data-size="xs" />
        		<div><i class="glyphicon glyphicon-comment"></i> <strong>{l s='Comment' mod='mymodcomments'} #{$comment.id_mymod_comment}:</strong> {$comment.comment}</div>
        	</div>
        	<hr />
        {/foreach}
        </div>


        <ul class="pagination">
            {for $count=1 to $nb_pages}
                {assign var=params value=[
                    'module_action' => 'list',
                    'product_rewrite' => $product->link_rewrite,
                    'id_product' => $smarty.get.id_product,
                    'page' => $count
                ]}
                {if $page ne $count}
                    <li><a href="{$link->getModuleLink('mymodcomments', 'comments', $params)}"><span>{$count}</span> </a></li>
                {else}
                    <li class="active current"><span><span>{$count}</span></span> </li>
                {/if}
            {/for}
        </ul>
    {/block}
{/block}

 

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...