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

Add file to page with plugin

Started by Robert 7 years ago · 0 replies · 647 views
7 years ago

I want to add a static image file to a page programmatically. I have tried using the onPageProcessed and onPageContentRaw events.

Using any of the events, I am able to save the file to the folder using standard PHP functions.

Unfortunately, I need to clear the cache to be able to see the image in my site (it is added to the page through the theme, like the header image in quark).

So I need to automatically clear/invalidate the page cache or add the image nicely through the Grav API (i think).

How should I do this?

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Mathieu Lecouturier, 1 day ago
0 53 1 day ago
Plugins · by Slebeig, 4 weeks ago
1 272 4 weeks ago
Plugins · by Rene, 2 months ago
2 432 2 months ago
Plugins · by Xavier, 2 months ago
2 345 2 months ago
Plugins · by Luka Prinčič, 7 years ago
3 1568 2 months ago