Show message if no entries are present in a collection #6777
-
I'm trying to display entries from a collection in a template using the However, I also want to display a message on the lines of No entries found. if no entries exist in the collection. I can't figure out how to do that using the collection tag. Here's the code I'm using:
Any help here would be amazing. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Have been able to figure this out, with a lot of help from @duncanmcclean on Discord. Letting this stay in case it can help someone else later. Using the
|
Beta Was this translation helpful? Give feedback.
Have been able to figure this out, with a lot of help from @duncanmcclean on Discord. Letting this stay in case it can help someone else later.
Using the
no_results
variable available inside the collection loop does the trick.