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 · 605 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 Slebeig, 5 days ago
1 104 5 days ago
Plugins · by Rene, 4 weeks ago
2 303 4 weeks ago
Plugins · by Xavier, 2 months ago
2 226 1 month ago
Plugins · by Luka Prinčič, 7 years ago
3 1413 2 months ago
Plugins · by Sebastian van de Meer, 2 months ago
1 322 2 months ago