Sorry for that post, but I really have a problem with the (basic) output of images with Kirby.
I’m using the extension: Selector – Kirby Fileselect Field for a team page in a collection. The editor can type in e.g. the name and can choose a picture from a generated list of the uploaded images in the page folder. This works well!
Problem A:
I want the correct path for the img tag.
This works for me, but it’s wierd to type in the page name, isn’t it?:
I played around with: $member->member_image() but the output was just filename.jpg but I need/want the full uri. Then I used $member->member_image()->url() and the output on my local server was: http://project.dev/filename.jpg → this is wrong. The image is located at http://project.dev/team/filename.jpg
I also tried to combine . page->url() . $member->member_image() or . page->url() . $member->member_image()->url() but than the pagename appeared twice.
Problem C can unfortunately not be solved easily, because the entry only outputs the raw values and can’t get the page object or the file object of the value. I believe that exact issue has come up somewhere else, still searching for it.
Problem B:
Almost There’s was a echo missing. This works! <img src="<?php echo $page->image($member->member_image()->value())->resize(400, 400)->url(); ?>" alt="Portrait <?php echo $member->member_name() ?>">
Problem C
Ah. O.k.! Then I tried to fake it with an fixed uri + raw output. If this breaks it’s not as bad as on the public pages.