Bernard8A Posted March 6, 2018 Share Posted March 6, 2018 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 More sharing options...
symdev Posted May 18, 2018 Share Posted May 18, 2018 Hello, I have the same problem, did you solve it? Thanks Link to comment Share on other sites More sharing options...
Bernard8A Posted May 23, 2018 Author Share Posted May 23, 2018 Hi Symdev I am afraid not. There's clearly not much participation on this forum and Prestashop's docs are just terrible. Link to comment Share on other sites More sharing options...
Kijam López Posted October 29, 2019 Share Posted October 29, 2019 Add parent::initContent(); Before this: $this->setTemplate( .... ); Best regards... 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now