-
-
Notifications
You must be signed in to change notification settings - Fork 600
Closed
Description
Hi Guys,
I'm having trouble checking to see if a value is in an array. I have a collection called websites, and it has an array of software which is an entries field pointing to another collection called software. I'm running the code below on the show page for the specific software entry
{{ collection:websites }}
{{ software }}
{{ if id == page:id }}
<p>manual: {{ id }}</p>
{{ /if }}
{{ /software }}
{{ if software | contains:{page:id} }}
<p>in_array: {{ id }}</p>
{{ /if }}
{{ /collection:websites }}
The manual loop running through the software loop correctly matches ids, but the contains loop doesn't. I get the same result using in_array.
The software entry id looks like this in its .md file
id: 61dec82d-101f-4417-a208-ad5d0d7dc34d
and the website entry looks like this
software:
- 61dec82d-101f-4417-a208-ad5d0d7dc34d
Even if I manually add the id as a string to the contains variable it still doesn't recognise it
j3ll3yfi5h
Metadata
Metadata
Assignees
Labels
No labels