Jump to content

PW as content API?


Mick
 Share

Recommended Posts

I am thinking about using processwire for a special task - I have a shopping site with many product categories stored in a category tree.


For each category id I want to provide content elements (texts, pictures, etc.)
So I would like to import the category tree into processwire and define a template there to hold the content elements.

My shopping site then would (via api?) send the category id to processwire and retrieve the content elements for this category id - so far my idea.

Is this possible and easy to realize with processwire?

Thanks!

Link to comment
Share on other sites

2 hours ago, Ivan Gretsky said:

Welcome to the forums, Mick! Sure you can do it. Look through these links:

  1. PW API way - http://processwire.com/api/include/
  2. Web service way -
  3. GrapQL way -

 

 

Thanks Ivan, that's just what I was looking for! Great!

Do you maybe also have an idea for the other part of my question? How to import a category (each category consisting of a unique id and a name) as a page-structure?

 

Link to comment
Share on other sites

It is all easily done with a script which bootstraps PW as shown above using api. The implementation depends only on where you are going to import from - a csv, xml or maybe from a remote database on cron to be always synchronized. There are tons of good examples on the forums. This is just a most recent one which is currently being answered.

If you'd rather use a gui module, there is one.

 

  • Like 1
Link to comment
Share on other sites

13 minutes ago, Ivan Gretsky said:

It is all easily done with a script which bootstraps PW as shown above using api. The implementation depends only on where you are going to import from - a csv, xml or maybe from a remote database on cron to be always synchronized. There are tons of good examples on the forums. This is just a most recent one which is currently being answered.

If you'd rather use a gui module, there is one.

 

Awesome! Thanks Ivan!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...