This code return only the page url, without image name: - $images = $section->picture()->split(); - foreach($images as $image): img(src="<?php echo $section->image($image)->url() ?>") - endforeach
<img src="http://127.0.0.1:8010/page/">
This code return an error: - $images = $section->picture()->split(); - foreach($images as $image): img(src="<?php echo $section->image($image)->toFile()->url() ?>") - endforeach Call to a member function url() on a non-object
This code return a file name: - foreach($section->picture()->split(',') as $image): - echo $image - endforeach
But with $image->url() or $image->toFile()->url() also return an error. Fatal error: Call to a member function toFile() on a non-object in
$(function() {
var a = $(".post_image_stream");
a.html(function(b, e) {
var c = $(".js_post_image_name", this).text().split(","),
d = $(".js_post_image_url", this).text();
return c.map(function(a) {
var b = new Image;
b.src = d + a;
return b
})
})
});
Please use Markdown code blocks when posting code in the forum in the future. They use three backticks at the start/end on separate lines. I have edited your post and you can check how that works when clicking on the pencil button.