Replies: 2 comments
-
Where did you get the The proper syntax looks like it would be |
Beta Was this translation helpful? Give feedback.
-
Re-read the docs at https://statamic.dev/antlers#modifiers and of course you are right! However it does not work. This updated code still don't remove duplicates:
But then again by trial and error I found out that using syntax with '=' does remove duplicates when combined with 'merge':
But does not work without 'merge':
In looping situation the '=' syntax doesn't do anything:
The documented version does remove duplicates but messes up the HTML similarly like in my initial post by looping div.row around each p element. How come..
So the whole thing remains a mystery to me. In the end I just wrote an ugly PHP workaround:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a collection of customer references which are tagged by multiple "countries" and "sectors" taxonomy terms.
My goal is to display 12 references that match the current site visitor country and segment. If there are less results, add more common global references.
Each reference can have multiple country and sector terms whcih may lead to duplicates in the combined array which I wish to handle.
My problem is that I can't get "unique" modifier to work. I have tried three aporaches which all failed:
Tried to get my head around it for about 12 hours stight, reading docs and using GPT but so far no luck.
Cheers, René
Beta Was this translation helpful? Give feedback.
All reactions