Jump to content

Recommended Posts

Posted

I am fairly new to Processwire and using APIs and I wanted to implement a certain functionality for one of my templates.

 

Suppose I want all pages that use template A to display wiki content associated with page->title  in  page->body .

For example if page->title is "Google",

I want the body to consist of the data present on https://en.wikipedia.org/wiki/Google

 

I understand that one way of doing this is using APIs from Wikipedia (but I do not have good experience in working with APIs)

Could someone guide me though the process or point me to an already available module for this functionality in Processwire?

 

 

 

 

Posted

There is no module i know of that can import external content, it is also somewhat complicated unless you know that the contents of the wikipedia page have some structure you can parse and get only the main text;  typically for something like this you would use the simple html dom parser and using a module/hook on save for that template and then put those contents into your body field... you'd have to probably write some logic to get only the part you need, using the dom parser api

another concept is to copy the page and paste it into your body field manually, and if you use the ImportExternalImages module, it should grab all of the images and add them to your local site.

 

  • Like 1

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
×
×
  • Create New...