Display article tags on blog page

For the past month, I’ve been suck in the same place. Unable to get the tags to display on the blog page. Thank you in advance for your support.

<?php snippet('header') ?>
<main class="blog">
	<div class="container">
		<?php foreach($page->children()->listed()->flip() as $article): ?>
		<div class="blog-item">
			<figure class="entry-thumbnail">
				<img src="<?= $article->files() ?>" alt="" class="img-cover">
			</figure>
			<a href="#" class="entry-category"><?= $article->tag() ?></a>
			<h2 class="entry-title"><a href="<?= $article->url() ?>"><?= $article->title()->html() ?></a></h2>
		</div> <!-- /.blog-item -->
	<?php endforeach ?>
	<div class="clearfix"></div>
</div> <!-- /.container -->
</main> <!-- /.blog -->
<?= snippet('footer') ?>
<?= snippet('navigation') ?>

What exactly is the problem? Nothing rendered at all? Sure your field name is correct? And if the field has multiple tags, not just one, then you would have to fetch the comma separated values into an array and loop through them.

Please post the blueprint for the article page…

Btw this doesn’t make sense, you are calling all files of the page here. What do you want to achieve with this code?

What exactly is the problem? Nothing rendered at all?
The problem is nothing rendered at all.

title: Article
num: '{{ page.date.toDate("Ymd") }}'
icon: 📖

status:
  draft:
    label: Draft
    text: The article is still in draft mode. It can only be seen by editors with panel access.
  unlisted:
    label: In Review
    text: The article is online and can be visited with the direct URL. The team must still give the final go to publish it.
  listed:
    label: Published
    text: The article is online and listed in the blog

columns:
  main:
    width: 2/3
    fields:
      text:
        type: textarea
        size: large

  sidebar:
    width: 1/3
    sections:
      meta:
        type: fields
        fields:
          date:
            type: date
            time: true
            default: now
          author:
            type: users
          tags:
            type: tags
          files:
            type: files

As I thought, your field is called tags not tag like in your template!

@texnixe I’m puzzled. That didn’t work.

No, still nothing at all? Does the field even have anything stored?

I fixed it, and it’s working. Here’s my final code; in the end, you need to make sure you save it before you test it. I was adding the tab/category but I didn’t save it after so it never showed up. Thanks for all you help.

<?php snippet('header') ?>
<main class="blog">
	<div class="container">
		<?php foreach($page->children()->listed()->flip() as $article): ?>
		<div class="blog-item">
			<figure class="entry-thumbnail">
				<?php
				$image = $article->files()->first();
				if($image):
					?>
					<img src="<?= $image->url() ?>" alt="<?= $image->alt() ?>" class="img-cover">
				<?php endif ?>
			</figure>
			<a href="#" class="entry-category"><?= $article->category()->first() ?></a>
			<h2 class="entry-title"><a href="<?= $article->url() ?>"><?= $article->title()->html() ?></a></h2>
		</div> <!-- /.blog-item -->
	<?php endforeach ?>
	<div class="clearfix"></div>
</div> <!-- /.container -->
</main> <!-- /.blog -->
<?= snippet('footer') ?>
<?= snippet('navigation') ?>