Hot answers tagged


For the second part of your question, look into Element Sources. You might be able to pull off something fancy in a module, where certain users have access to different sources. For the first part of your question, look into the EVENT_REGISTER_TABLE_ATTRIBUTES and EVENT_SET_TABLE_ATTRIBUTE_HTML events. Here is a rough example of how it will look... // Add ...


There's an easier way... Twig has a built-in variable in for-loops called loop, which has loop.index and loop.index0 properties which output exactly what you're looking for: {% for project in sliderWork %} <div class="progress__wrap"> <span data-slick-index="{{ ...


Since this is a module rather than a plugin, you need to register control panel template roots, like so: Event::on( View::class, View::EVENT_REGISTER_CP_TEMPLATE_ROOTS, function (RegisterTemplateRootsEvent $e) { $e->roots['app-module'] = __DIR__ . '/templates/cp'; } ); (I've swapped 'custom' for 'app-module' as I think it's a ...


I have managed to figure it out. I will use the following and it seems to work fine {% set indexCounter = ( counter | default(0) ) %} {% set counter = ( counter | default(0) ) + 1 %} Hope this can be of help to someone.

Only top voted, non community-wiki answers of a minimum length are eligible