---
title: 'How to use image from page folder into theme folder'
url: 'https://getgrav.org/forum/themes-styling/how-to-use-image-from-page-folder-into-theme-folder-t863'
markdown: 'https://getgrav.org/forum/themes-styling/how-to-use-image-from-page-folder-into-theme-folder-t863.md'
date: '2026-06-21'
description: 'I would like to refernece an image from page folder inside a template (theme folder). Is that possible? if so, what do you need to do to use an image in page'
---

[Themes & Styling](https://getgrav.org/forum/themes-styling)

#   How to use image from page folder into theme folder 

 Solved by Paul Massendari [View solution](https://getgrav.org/forum/themes-styling/how-to-use-image-from-page-folder-into-theme-folder-t863#post-19791)

  Started by Usk70 9 years ago · 3 replies · 1230 views    

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-use-image-from-page-folder-into-theme-folder-t863#post-19726 "Permalink") 

I would like to refernece an image from page folder inside a template (theme folder).

Is that possible? if so, what do you need to do to use an image in page folder from the template? (the idea is that the exact name of the image would be configured in a variable)

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-use-image-from-page-folder-into-theme-folder-t863#post-19741 "Permalink") 

If you want to get an image located in a particular page folder using twig:
`{% set my-page-image = page.find('/my/page/path').media['image-name'] %}`

then you could output the image html like `{{ my-page-image.html }}` or `<img src="{{ my-page-image.url }}" />`

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-use-image-from-page-folder-into-theme-folder-t863#post-19787 "Permalink") 

Thanks, what if I would like to find an image from the page that invoked the template? -i.e., in twig you can not reference the exact page path as it might be different each time-

 [9 years ago](https://getgrav.org/forum/themes-styling/how-to-use-image-from-page-folder-into-theme-folder-t863#post-19791 "Permalink")  Solution 

you can just use page instead of page.find , exemple:
{{ page.media.images|first }} --> Display the first image of the page
{{ page.media\['myimage.jpg' \]}} --> Display myimage.jpg
{{ page.media\[header.selectedimage\] }} --> Display the image selected in header.selectedimage

 👍 1 

[Log in](https://getgrav.org/login?return=%2Fforum%2Fthemes-styling%2Fhow-to-use-image-from-page-folder-into-theme-folder-t863) to reply.

###  Suggested topics

 | Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| [Modular Page Background Image Display](https://getgrav.org/forum/themes-styling/modular-page-background-image-display-t9486)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by TomW, 2 weeks ago |  | 2 | 200 | [2 days ago](https://getgrav.org/forum/themes-styling/modular-page-background-image-display-t9486 "by TomW") |
| [Inheriting a Theme does not quite work correctly](https://getgrav.org/forum/themes-styling/inheriting-a-theme-does-not-quite-work-correctly-t9501)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by themetman, 3 days ago |  | 0 | 48 | [3 days ago](https://getgrav.org/forum/themes-styling/inheriting-a-theme-does-not-quite-work-correctly-t9501 "by themetman") |
| [\[quark\] mobile menu as the modular page menu](https://getgrav.org/forum/themes-styling/quark-mobile-menu-as-the-modular-page-menu-t1132)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by Bruno, 4 years ago |  | 4 | 1321 | [3 days ago](https://getgrav.org/forum/themes-styling/quark-mobile-menu-as-the-modular-page-menu-t1132 "by AH") |
| [Grav2 with Quark2 – All pages in the hamburger-menu of a one-pager](https://getgrav.org/forum/themes-styling/grav2-with-quark2-all-pages-in-the-hamburger-menu-of-a-one-pager-t9485)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by AH, 2 weeks ago |  | 0 | 173 | [2 weeks ago](https://getgrav.org/forum/themes-styling/grav2-with-quark2-all-pages-in-the-hamburger-menu-of-a-one-pager-t9485 "by AH") |
| [Is it a way to get the "content - summary" in a twig template ?](https://getgrav.org/forum/themes-styling/is-it-a-way-to-get-the-content-summary-in-a-twig-template-t9431)    [Themes & Styling](https://getgrav.org/forum/themes-styling) · by FrViPofm, 2 months ago |  | 4 | 668 | [1 month ago](https://getgrav.org/forum/themes-styling/is-it-a-way-to-get-the-content-summary-in-a-twig-template-t9431 "by Paul Hibbitts") |
