Closed denniserdmann closed 1 month ago
If I understand your setup correctly the desired URL structure is unfortunately not possible because Contao can't differentiate if /tag
is a tag or the alias of an actual news article. For this reason we added the Use GET-Parameter
in the News Tag Cloud
module. This should do the trick.
ok, that's what i already thought.
Is there an option to use the Get-Parameter for <?= $tag; ?>
(for example in a news_latest template), too?
There is no way to configure the behaviour directly but there is some template magic that can help.
Assuming you're in a news_list
or news_full
:
<?php if( $this->tags ): ?>
<div class="tags">
<ul>
<?php foreach( $this->tags as $i => $tag ): ?>
<li>
<a href="<?= \numero2\TagsBundle\Util\TagUtil::generateUrlWithTags($objPage,[$this->tagsRaw[$i]['tag']],true) ?>">
<?= $this->tagsRaw[$i]['tag'] ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
Note: You may need to replace $objPage
with the PageModel
of the desired page.
Moin!
I have 2 pages
notizen
)notizen
)and would like to use the News List Modul for both showing the unfiltered list and the filtered tags list to get an url like this:
notizen/tag/tag1
but get an error 404 instead. I also tried contao route priority and a third page News Tags with the same alias but thats probably not allowed as i can not save the alias.Is such scenario possible?