php - October CMS | display images on reordering lists -
there way turn on reorder functionality on list controller , re-order list items name
example...
but there way display images instead of text on reorder list?
what have now:
config_reorder.yaml
title: 'configurar ordem' azuref: ref azuimg: image modelclass: frama\azulejos\models\azulejo toolbar: buttons: reorder_toolbar
reordercontroller.php
... public function __construct($controller) { ... $this->azuimg = $this->getconfig('azuimg', $this->azuimg); ... } ...
and result of course text... , don't know that... need access path or (better) getthumb
edit
ok can path that, transforming sting:
json_decode($this->reordergetrecordimg($record))->path
but how make thumb work?
solution
well solution easy ***k :)
modules/backend/behaviors/rendercontroller/partials/_records.htm
<?php foreach ($records $record): ?> <!-- ... --> <img src="<?= $record->image->getthumb(50,'auto',['mode' => 'landscape']) ?>" alt=""> <!-- ... --> <?php endforeach ?>
or:
modules/backend/behaviors/rendercontroller/partials/_records.htm
<?php foreach ($records $record): ?> <!-- ... --> <img src="<?= $this->reordergetrecordimg($record) ?>" alt=""> <!-- ... --> <?php endforeach ?>
reordercontroller.php
... public function __construct($controller) { ... $this->azuimg = $this->getconfig('azuimg', $this->azuimg); ... } ... public function reordergetrecordimg($record) { return $record->image->getthumb(50,'auto',['mode' => 'landscape']); } ...
Comments
Post a Comment