Skip to content

How do I add tags to entries on the blog start page? My links aren't picking up the URL base there, but do elsewhere. #698

Discussion options

You must be logged in to vote

I think you're almost there. In the blog-start layout you should use getLocation(true) without additional API calls. Have a look at the author URL code in the entry meta section, it slightly differs from your tag URL's. Here is an example to show tags in blog-start layout.

<?php if ($page->isExisting("tag")): ?>
<div class="entry-tags">
<p><?php echo $this->yellow->language->getTextHtml("blogTag") ?> <?php $tagCounter = 0; foreach (preg_split("/\s*,\s*/", $page->get("tag")) as $tag) { if (++$tagCounter>1) echo ", "; echo "<a href=\"".$this->yellow->page->getLocation(true).$this->yellow->toolbox->normaliseArguments("tag:$tag")."\">".htmlspecialchars($tag)."</a>"; } ?></p>
</div>
<?php endi…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cellio
Comment options

@markseuffert
Comment options

Answer selected by cellio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants