pwired Posted September 23, 2014 Share 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"/> Link to comment Share on other sites More sharing options...
adrian Posted September 23, 2014 Share Posted September 23, 2014 $image = $page->images->get("name=picture.jpg"); 6 Link to comment Share on other sites More sharing options...
pwired Posted September 23, 2014 Author Share Posted September 23, 2014 how could i have missed that. $image = $page->images->get("name=picture.jpg"); thanks adrian. 2 Link to comment Share on other sites More sharing options...
dotnetic Posted July 6, 2016 Share Posted July 6, 2016 Maybe you want to mark this question as answered? 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