Refine muuri pinboard layout, spacing and remove randomization

This commit is contained in:
Jürgen Mummert
2026-03-04 18:38:19 +01:00
parent c863ab98f0
commit ab5e9b30b5
4 changed files with 99 additions and 131 deletions
@@ -6,6 +6,7 @@ namespace Eiswurm\ContaoPinboardBundle\Controller\FrontendModule;
use Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController;
use Contao\CoreBundle\Image\Studio\Studio;
use Contao\CoreBundle\InsertTag\InsertTagParser;
use Contao\CoreBundle\Twig\FragmentTemplate;
use Contao\FilesModel;
use Contao\ModuleModel;
@@ -18,6 +19,7 @@ final class PinboardController extends AbstractFrontendModuleController
{
public function __construct(
private readonly Studio $studio,
private readonly InsertTagParser $insertTagParser,
) {
}
@@ -60,7 +62,7 @@ final class PinboardController extends AbstractFrontendModuleController
'id' => (int) $entry->id,
'headline' => (string) $entry->ueberschrift,
'text' => (string) $entry->text,
'link' => (string) $entry->link,
'link' => $this->resolveLink((string) $entry->link),
'dateAdded' => (int) $entry->dateAdded,
'dateModified' => (int) $entry->dateModified,
'imageFigure' => $imageFigure,
@@ -74,4 +76,15 @@ final class PinboardController extends AbstractFrontendModuleController
return $template->getResponse();
}
private function resolveLink(string $link): string
{
$link = trim($link);
if ('' === $link) {
return '';
}
return html_entity_decode($this->insertTagParser->replaceInline($link), \ENT_QUOTES | \ENT_HTML5);
}
}