pwired Posted September 23, 2014 Posted September 23, 2014 Finding images goes like this: $image = $page->images->first();$image = $page->images->getRandom(); How do you find an image by it´s image name, e.g. picture.jpg ? Is it possible to find an image by it's image name ? Maybe something like this: $image = $page->images->{picture.jpg}(); If that is not possible what about using the api for finding images that you store in the assets folder ? $image = $page->images-> { url to the picture in the assets folder}(); If that is also not possible, then would it be possible to use php code: $image = php code { url to the picture in the assets folder}(); If that is also not possible, then is the img tag the only possibility ? <img src="<?php echo $config->urls->site?>assets/pics/picture.jpg"/>
adrian Posted September 23, 2014 Posted September 23, 2014 $image = $page->images->get("name=picture.jpg"); 6
pwired Posted September 23, 2014 Author Posted September 23, 2014 how could i have missed that. $image = $page->images->get("name=picture.jpg"); thanks adrian. 2
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