mtn Posted February 22, 2018 Share Posted February 22, 2018 On a "site-settings" page, I have a "watches" image field that contains 5 images. The first and last are easily echo-ed with"$a->first();" and "$a->last();", but I am having difficulty in creating the correct syntax to display images 2-4. Any help would be appreciated. Thank you! Present code: <?php $selectWatch = $pages->get("/site-settings/")->watches; $watchOne = $selectWatch->first(); echo "<img src='{$watchOne->url}' alt='{$watchOne->description}' class='time'>"; ?> Link to comment Share on other sites More sharing options...
fbg13 Posted February 22, 2018 Share Posted February 22, 2018 $first = $selectWatch->eq(0); $second = $selectWatch->eq(1); $third = $selectWatch->eq(2); https://processwire.com/api/ref/wire-array/eq/ 1 1 Link to comment Share on other sites More sharing options...
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