Jump to content

Directus and ProcessWire


asbjorn
 Share

Recommended Posts

Has anyone integrated Directus with ProcessWire? I have a database in Directus that I want to sync with ProcessWire (create/update/delete pages). But I don't not know where to start. It might be possible with ProcessWire's API in some way?

Link to comment
Share on other sites

The one-off task was rather easy, and I have managed this using the php sdk as you mention.

But I'm not sure about how to go further, setting up a continuous synchronization. One-way, from Directus to ProcessWire. I'm new to this way of thinking (working with APIs). Should I use «cron jobs» of some sort? Or rely on Directus «pushing» when something is updated?

Any good ideas are welcomed. Maybe this post could also be a heads up to others who are new to this …

Link to comment
Share on other sites

I still have the need for ProcessWire to create a page for each item in Directus database. And be able to update the title if the item changes. And also I would prefer to keep working with the ProcessWire API, because of the way the end point for this import («person pages») is integrated with the rest of the website.

Link to comment
Share on other sites

I'd really suggest you to sort out why you need to have data in multiple places (especially edit them in multiple places). Keeping things in sync is a task, where so many things can go wrong, that it's often the better solution to keep things in one place. If you really need to sync stuff, one way sync (essentially caching) is the simple option, because you can just discard anything on the receiving end without worrying to overwrite any changes (especially useful if something did went wrong and you need to fix that). Two way sync is the hard part, especially as you need to handle things like potential downtime of both services, network issues, missed updates and so on. 

  • Like 1
Link to comment
Share on other sites

This will be a one-way sync (as I mentioned in my second post in this thread). The data will only be updated in the Directus database. No editing on these data will be done in ProcessWire.

Also said, but in other words: When the data is imported (to ProcessWire) and kept updated/synced, I will be able to use the ProcessWire API to handle the data as per today. Meaning no extensive recoding of templates and so.

Link to comment
Share on other sites

Then it depends on directus how you keep things in sync. Either you trigger the sync in intervals or manually, where you simply recreate all pages, which have been updated in directus since the previous sync. Or directus does support some mechanism to trigger external things, if someone does update content. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...