Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Display image from theme blueprint

Started by Muut Archive 10 years ago · 2 replies · 658 views
10 years ago

Hi
I have a file upload field in my themes blueprint. Once a file is uploaded how do I display it in my twig template files?

10 years ago

Depending on how you defined the blueprint, you will store the data for the uploaded file in the theme's yams configuration file. Then it's just a matter of getting the value and then getting the path/name of the file from that. If you can provide an example of your blueprint and your saved theme yaml I can help you with details.

9 years ago

Hi rhukster
Thanks for the help, I figured it out through looking at the yaml files. I have actually abandoned what I was doing though in favour of storing my images in an images page as it works better for my site and then accessing them via page.find('/images').media['my-image.jpg'].

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago