Hello guys,
I am trying to create a custom Grid ColumnType. But I have an error explaining symfony can't find my new template inside my module's code. (An exception has been thrown during the rendering of a template ("Content template for column type "likes" was not found")).
But the thing is, it works fine locally, but not on my remote test server. I tried to clear cache but can't manage to make it work over there. When I manually return :
"return '@Modules/mymodule/views/Prestashop/Admin/Common/Grid/Columns/Content/likes.html.twig';" in GridExtension::getTemplatePath() it works...
I don't understand what's going on, why twig can't find my override ?
namespace XXXX\YYY\Grid\Column\Type\Common; use PrestaShop\PrestaShop\Core\Grid\Column\AbstractColumn; use Symfony\Component\OptionsResolver\OptionsResolver; final class LikesColumn extends AbstractColumn { /** * {@inheritdoc} */ public function getType() { return 'likes'; } /** * {@inheritdoc} */ public function configureOptions(OptionsResolver $resolver) { $resolver ->setRequired([ 'field', ]) ->setDefaults([ 'clickable' => true, ]) ->setAllowedTypes('field', 'string') ; } }
in: /modules/mymodule/views/Prestashop/Admin/Common/Grid/Columns/Content/likes.html.twig
<div class="col-md-6"> <i class="material-icons">favorite</i> {{ record[column.options.field] }} </div>