# Image source unknown

**URL:** <https://forum.getkirby.com/t/image-source-unknown/13114>\
**Category:** Questions\
**Tags:** v3\
**Created:** [February 28, 2019, 8:35am UTC](https://forum.getkirby.com/t/image-source-unknown/13114 "2019-02-28T08:35:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SinghiVanith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@SinghiVanith](https://forum.getkirby.com/u/SinghiVanith)\
**Post date:** [February 28, 2019, 8:35am UTC](https://forum.getkirby.com/t/image-source-unknown/13114/1 "2019-02-28T08:35:34Z")

</div>

Hi, I am trying to fetch cover pictures of subpages to create a projects overview. I am using this

```
<?php foreach($page->children() as $subpage): ?>
  <li>
     <a href="<?php echo $subpage->url() ?>">

  	<?php if($image = $subpage->cover()): ?>
    		<img src="<?php echo $image->url() ?>"/>
  	<?php endif ?>

	<?php echo html($subpage->title()) ?>
	</a>
  </li>
<?php endforeach ?>

```

It works fine with the title but the for the images its saying

`<img src(unknown)>`

I have tried this one as well but then the img tag is not showing up at all:

```
<?php if($image = $subpage->cover()->toFile()): ?>
    	<img src="<?php echo $image->url() ?>"/>
 <?php endif ?>

```

Can someone help me? Thanks!

---

<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:** [February 28, 2019, 8:42am UTC](https://forum.getkirby.com/t/image-source-unknown/13114/2 "2019-02-28T08:42:37Z")

</div>

What is `cover` in your blueprint? A files field? A files section? Please post your blueprint. If `cover` was a files field, you last example should work.

---

<div class="post-metadata">

**Author:** ![SinghiVanith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@SinghiVanith](https://forum.getkirby.com/u/SinghiVanith)\
**Post date:** [March 5, 2019, 12:19pm UTC](https://forum.getkirby.com/t/image-source-unknown/13114/3 "2019-03-05T12:19:09Z")

</div>

Hi Texnixe,  
thanks for you response. I somehow managed to get it work with this blueprint:

```
title: Projekt

status:
  draft: Draft
  listed: Published

columns:
  - width: 1/3
sections:
  images:
    type: files
    layout: list
    template: image
    info: "{{ file.dimensions }}"
    image:
      ratio: 5/4
      cover: true
    min: 1
    size: small
  unterseiten:
    headline: Unterseiten
    type: pages
    status: draft
    templates: default

  - width: 2/3
fields:
  cover:
    type: files
    multiple: false
  headline:
    type: text
  description:
    type: textarea
    tags: true

```

I cant really tell what I did to make it right. However Thanks again for your help.
