joe_g Posted September 22, 2021 Posted September 22, 2021 Hi there, Is there a more elegant way to check if there is at least one item in an image array, currently do if($page->images && $page->images->first) - too long! tx!
Zeka Posted September 22, 2021 Posted September 22, 2021 Hi. You can try to use $page->if() https://processwire.com/api/ref/page/if/ if($page->if('image')) { // ... } $page->if('image', function($image) { // ... }) 3
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now