Refine muuri pinboard layout, spacing and remove randomization
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user