Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Add file to page with plugin

Started by Robert 8 years ago · 0 replies · 742 views
8 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 complanar, 6 days ago
6 268 2 days ago
Plugins · by BenLaKnet, 3 days ago
1 98 3 days ago
Plugins · by complanar, 4 weeks ago
2 416 3 weeks ago
Plugins · by Vladimir Novak, 2 months ago
3 707 2 months ago
Plugins · by Mathieu Lecouturier, 2 months ago
3 547 2 months ago