# Get specific background image

**URL:** <https://forum.getkirby.com/t/get-specific-background-image/6690>\
**Category:** Questions\
**Tags:** v2\
**Created:** [February 21, 2017, 1:23pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690 "2017-02-21T13:23:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_for\_manu](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/m_for_manu/32/1379_2.png) [@m\_for\_manu](https://forum.getkirby.com/u/m_for_manu)\
**Post date:** [February 21, 2017, 1:23pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/1 "2017-02-21T13:23:13Z")

</div>

Hi there.  
I would like to set specific background-images and at the moment i can get the first image like this:  
`<div class="imagewide" style="background: url(<?php echo $page->image()->url() ?>) no-repeat center top;">`

i changed the line, which causes a server error:  
`<div class="imagewide" style="background: url(<?php echo kirbytext($page->bigimage())->url() ?>) no-repeat center top;">`  
or  
`<div class="imagewide" style="background: url(<?php echo kirbytext($page->bigimage()->url()) ?>) no-repeat center top;">`

Do I have to do a workaround? Place the variable in the stylesheet? Using `$page->bigimage` (which is the label) parses wrong.

Thanks in advance!

---

<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 21, 2017, 1:33pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/2 "2017-02-21T13:33:06Z")

</div>

I suppose big image contains a filename

```auto
<?php
$image = $page->bigimage()->toFile(); 
?>
<div class="imagewide" style="background: url(<?php if($image) {echo $image->url(); } ?>) no-repeat center top;">

```

---

<div class="post-metadata">

**Author:** ![m\_for\_manu](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/m_for_manu/32/1379_2.png) [@m\_for\_manu](https://forum.getkirby.com/u/m_for_manu)\
**Post date:** [February 21, 2017, 1:40pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/3 "2017-02-21T13:40:40Z")

</div>

Yes it has. As it is in the txt:

> Bigimage: (image: imagename-big.jpg)

but the url is empty now. (style=“background: url() no-repeat center top;”)  
the image is in the same folder.

---

<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 21, 2017, 1:43pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/4 "2017-02-21T13:43:08Z")

</div>

It does not make sense to use a kirbytag in such a field. I’d use an image field.

---

<div class="post-metadata">

**Author:** ![m\_for\_manu](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/m_for_manu/32/1379_2.png) [@m\_for\_manu](https://forum.getkirby.com/u/m_for_manu)\
**Post date:** [February 21, 2017, 1:53pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/5 "2017-02-21T13:53:29Z")

</div>

How to, without the panel?

---

<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 21, 2017, 1:56pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/6 "2017-02-21T13:56:01Z")

</div>

Without the panel, just use the filename, without the tag.

```auto
bigimage: imagename-big.jpg

```

---

<div class="post-metadata">

**Author:** ![m\_for\_manu](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/m_for_manu/32/1379_2.png) [@m\_for\_manu](https://forum.getkirby.com/u/m_for_manu)\
**Post date:** [February 21, 2017, 1:58pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/7 "2017-02-21T13:58:31Z")

</div>

aah, didn’t know about this small detail! saves some other things now, too. 😁

thank you very much!

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:52pm UTC](https://forum.getkirby.com/t/get-specific-background-image/6690/8 "2025-02-06T16:52:40Z")

</div>

Archived on February 6, 2025, 4:52pm UTC


