SOLVED - Project tags in individual <li> for each project thumbnail

In each of my project thumbnails I can do this to have my project tags visible within one list element.

<ul>
    <li><?php echo $project->tag() ?></li>
</ul>

But I want to list them so each project tag is in its own list element. I have tried:

<ul>
    <?php foreach($project->tags(): ?>
         <li><?php echo $project->tag() ?></li>
    <?php endforeach ?>

But this doesn’t work. Any help appreciated

<?php foreach($project->tags()->split() as $tag: ?>
       <li><?php echo $tag ?></li>
<?php endforeach ?>

Default is a comma separated list as input, if you’re using another separator, you need to specify it: http://getkirby.com/docs/cheatsheet/field-methods/split

3 Likes