# Image Preview Default

**URL:** <https://forum.getkirby.com/t/image-preview-default/15378>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 23, 2019, 3:11pm UTC](https://forum.getkirby.com/t/image-preview-default/15378 "2019-08-23T15:11:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kinkwilde](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kinkwilde](https://forum.getkirby.com/u/kinkwilde)\
**Post date:** [August 23, 2019, 3:11pm UTC](https://forum.getkirby.com/t/image-preview-default/15378/1 "2019-08-23T15:11:02Z")

</div>

Referring to the documentation - [Pages section | Kirby CMS](https://getkirby.com/docs/reference/panel/sections/pages#preview-images)

It shows I can create a model and then use `image: page.previewImage` So that I can display a default image from the assets folder or then display an image if it has been uploaded.

But if I have

```
image:
  cover: true
  ratio: 5/4

```

What is the option for this preview?

For example is it something like this?

```
image:
  cover: true
  ratio: 5/4
  preview: page.previewImage

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 23, 2019, 3:22pm UTC](https://forum.getkirby.com/t/image-preview-default/15378/2 "2019-08-23T15:22:25Z")

</div>

No:

```auto
image:
  cover: true
  ratio: 5/4
  query: page.previewImage

```

(but it’s in the docs)

 ![45](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/5/5649bcd5b84885f616f61892515d5cce162a609b.png)

---

<div class="post-metadata">

**Author:** ![kinkwilde](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kinkwilde](https://forum.getkirby.com/u/kinkwilde)\
**Post date:** [August 23, 2019, 3:41pm UTC](https://forum.getkirby.com/t/image-preview-default/15378/3 "2019-08-23T15:41:48Z")

</div>

Shouldn’t `kirby()->root('assets') . "/assets/images/default.jpg")` just be `kirby()->root('assets') . "/images/default.jpg")` as root(‘assets’) will be at /assets/ anyway.

And I use query for other things, but just because it’s in the documentation unrelated to the new feature doesn’t mean it’s clear that’s how you do it.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 23, 2019, 3:51pm UTC](https://forum.getkirby.com/t/image-preview-default/15378/4 "2019-08-23T15:51:55Z")

</div>

> [@kinkwilde](#):
>
> Shouldn’t `kirby()->root('assets') . "/assets/images/default.jpg")` just be `kirby()->root('assets') . "/images/default.jpg")`

Yes, definitely. Will fix. Is fixed. Thanks for pointing it out.

> [@kinkwilde](#):
>
> And I use query for other things, but just because it’s in the documentation unrelated to the new feature doesn’t mean it’s clear that’s how you do it.

The new feature only relates to using assets, doesn’t change the default way of querying a preview image.

---

<div class="post-metadata">

**Author:** ![kinkwilde](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kinkwilde](https://forum.getkirby.com/u/kinkwilde)\
**Post date:** [September 11, 2019, 2:01pm UTC](https://forum.getkirby.com/t/image-preview-default/15378/5 "2019-09-11T14:01:13Z")

</div>

I am going to need to re-open this.

I have a field associated to my **album.yml** that is called ‘cover’. This is just a type of files.

**pages/album.yml**

```
      # cover photo
      cover:
        type: files
        label:
          en: Cover Photo
          de: Cover Photo
        min: 1
        multiple: false

```

I then have a section called **albums.yml** which is used to display the album in the panel. This isn’t straying too far from what is inside the starterkit already.

**sections/albums.yml**

```
# TYPE
type: pages
# HEADLINE
headline:
  en: Photography
  de: Photography
# TEMPLATE
template: album
# OPTIONS
empty:
  en: No albums yet
  de: No albums yet
image:
  cover: true
  ratio: 5/4
  query: page.cover
info: "{{ page.images.count }} image(s)"
layout: cards
parent: kirby.page("photography")
size: tiny

```

**pages/albums.yml**

```
  # SECTION: Unlisted
  unlisted:
    extends: sections/albums
    status: unlisted
    headline:
      en: Ready For Review
      de: Ready For Review

```

The query on the image above ‘page.cover’ doesn’t work and the preview that the panel is showing is just an icon and not the cover picture.

Where am I going wrong? (I hope this all made sense btw xD)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 11, 2019, 2:46pm UTC](https://forum.getkirby.com/t/image-preview-default/15378/6 "2019-09-11T14:46:11Z")

</div>

In the Starterkit, there is a custom page model. Is that still present in your project? In any case you have to return a file object, without the plugin you can do that with `page.cover.toFile()`

---

<div class="post-metadata">

**Author:** ![kinkwilde](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kinkwilde](https://forum.getkirby.com/u/kinkwilde)\
**Post date:** [September 11, 2019, 2:53pm UTC](https://forum.getkirby.com/t/image-preview-default/15378/7 "2019-09-11T14:53:47Z")

</div>

OK, so some things I can still use like toFile() - I’ll keep that in mind for next time.
