Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Add file to page with plugin

Started by Robert 8 years ago · 0 replies · 711 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, 5 days ago
0 117 5 days ago
Plugins · by Vladimir Novak, 1 month ago
3 581 1 month ago
Plugins · by Mathieu Lecouturier, 1 month ago
3 394 1 month ago
Plugins · by Slebeig, 2 months ago
1 509 2 months ago
Plugins · by Rene, 3 months ago
2 702 3 months ago