Sunny Posted December 21, 2013 Posted December 21, 2013 I need to create content pragmatically. e.g. In the admin I plan on creating a button that will create a bunch of pages from a json feed. Is this possible? Can you point me to the correct API? Thanks.
diogo Posted December 21, 2013 Posted December 21, 2013 You use http://php.net/json_decode or a specific library to turn the json into a PHP array, and then use the PW API to create the pages. Here is a good example of how to do it: http://processwire.com/talk/topic/352-creating-pages-via-api You might also want to have a look at the code of this module to take some ideas, since it does exactly that: https://github.com/adrianbj/ProcessPageTreeMigrator 4
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now