getkirby / starterkit

Kirby's sample site – the easiest way to get started with Kirby
https://getkirby.com
176 stars 51 forks source link

Demo: Cover Field still renders a image even no cover is selected #19

Closed scsskid closed 3 years ago

scsskid commented 3 years ago

Describe the bug

in the blog example (demo or starterkit), if deselecting/removing a cover image, it is still sourced from Images and rendered in template the first image is sourced even its not selected as cover even when dumping $page->cover() it is poiting to image file, so its not a matter of the template So to check for cover isEmpty is not possible without an additional field

To Reproduce
Steps to reproduce the behavior: see above

Expected behavior
should not render in template if no cover is selected

Screenshots
image image

Kirby Version
3.5.1

afbora commented 3 years ago

Actually this is expected. Because this is set in the page model.

https://github.com/getkirby/starterkit/blob/master/site/models/note.php#L22-L25

scsskid commented 3 years ago

thanks, I missed this