Open beckysoll opened 6 years ago
I should add, offset does not work in exactly the same way limit doesn't work.
The issue is that no modifiers work :)
Aaaaah, well that'll do it.
Hmm, seems to work for me, but in maybe an unexpected way...
I have three terms on this post:
{{ tags }}{{ title }}<br>{{ /tags }}
coffee
harry-potter
spring
The limit of 1 works for me, but title
isn't available, so it gets that from the post's context:
{{ tags limit="1" }}{{ title }}<br>{{ /tags }}
Test Blog Post
If I echo value
instead of title
, it works as expected:
{{ tags limit="1" }}{{ value }}<br>{{ /tags }}
coffee
@beckysoll It returns nothing at all for you?
Expected behaviour
On an entry, i'd expect to be able to loop through linked taxonomy terms (from an actual taxonomy field, eg. categories) and add a limit like so
{{ categories limit="1" }}{{ title }}{{ /categories }}
Actual behaviour
It returns nothing. If i remove the limit and wrap the inside of the categories loop with {{ if first }} that works. I can also do {{ categories:0 }} but then i'm not able to pull in the taxonomy's data, just the actual slug.
Steps to reproduce
Server Details
Operating System: Mac OS (working locally)
Web Server: Apache via MAMP Pro
PHP Version: 7.1.12
Statamic Version: 2.8.8
Updated from an older Statamic or fresh install: updated
List of installed addons: anchor, increment, expires on (mine)