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

On Page Save

Started by Muut Archive 10 years ago · 4 replies · 615 views
10 years ago

I'm trying to write a plugin that posts to twitter when a new blog post is created. This is my thinking:

  • Listen for a save event
  • Check if data exists in the storage
  • Check taxonomy
  • Evaluate and act

The problem that I'm facing is that I'm not sure which event to use. I'm new to Grav, so I'm probably just missing something... I've looked at the Grav lifecylce to ascertain what event to use, but it seems to me that most of the events are aimed at "front-end" events (or events concerned with the delivery of the content, not so much the creation)

Could someone perhaps point me in the right direction?

10 years ago

Thanks Sommerregen. I was actually just starting to look at the Admin plugin, but this saves me some time.

For my use case, I'm happy with my plugin only being triggered by admin, but I guess if I was to make the plugin available to the community, I should consider the filesystem too?

10 years ago

Yes, as long as you only care about the Admin that's totally enough. Considering the filesystem besides the admin use case is much appreciated, but should not be mandatory to publish your plugin. Even if your plugin only supports Admin for the moment, it will definitely an enrichment for the Grav community! :-)

10 years ago

Let's see how it goes;) I'll try for the most versatile.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1366 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago