starterkit icon indicating copy to clipboard operation
starterkit copied to clipboard

`cover.yml` blueprint does not select images in note page due to images using the template `blocks/image` instead of `image`

Open miragecraft opened this issue 1 year ago • 4 comments

blueprints\fields\cover.yml file is used in multiple places, however it does not allow you to select images on the note page because the note page uses blocks/image as template while cover.yml is using the query page.images.template('image').

I can fix this by changing it to page.images to omit the template, or page.images.filterBy("template", "in", ["image", "blocks/image"]) to include both.

miragecraft avatar Aug 28 '22 17:08 miragecraft

This is on purpose. The cover field defined in cover.yml is used in two places: note.yml and album.yml. The field queries images with the image blueprint assigned which is also the template that is assigned to uploads through this field. While the files section uses the blocks/image file template/blueprint.

texnixe avatar Aug 28 '22 20:08 texnixe

Ok, I think I know what it's doing - the blocks/image template is used so that the image block item can select it.

However why make images under blocks/image template unavailable to be selected as cover?

The main gripe I have with this, is that by default the cover is set to one of the blocks/image files, so you're presented with an initial setup that's not possible to re-create using the blueprint provided.

That seems wrong?

miragecraft avatar Aug 28 '22 21:08 miragecraft

@texnixe Have to agree here with @miragecraft. It seems wrong to have currently a cover selected but when one wants to change the selection no images are available to select - not even the one that is currently selected. That seems to contradict itself and isn't a great yes experience for the files field.

distantnative avatar Aug 29 '22 05:08 distantnative

@distantnative Right, the selected image should of course have the template assigned for upload, otherwise it doesn't make sense. Other than that, it might make sense to keep the distinction between the the template assigned to the field and the section, so that a cover image is not used again within the text, and for learning purposes.

texnixe avatar Aug 29 '22 06:08 texnixe