Jump to content

PageListSelect with external data


thomas
 Share

Recommended Posts

Hello,

I need to connect two PW sites, both with rather big pagetrees. When adding a page to site A, the editor should be able to select one or more related pages from site B (one is an editorial news site, the other a product cataloque)

My idea was to build an API for site B which writes JSON data of the applicable pages and feed that into my custom inputfield which would be heavily influenced by PageListSelect. Now my questions:

Has anyone built something similar? Since this would be my first custom field / inputfield, where should I look for help? Does this sound like a reasonable approach or are there other ways to connect two PW sites?

Thanks for any help,

thomas

Link to comment
Share on other sites

Just an idea...but maybe you can adapt this module to your needs and grad the select data from a different db:

https://processwire.com/talk/topic/9320-fieldtype-select-external-option/

or you use on site B a kind of webservice page that output json with id|title|url and use this in site A?

http://modules.processwire.com/modules/service-pages/

just some notes on this issue...

regard mr-fan

  • Like 1
Link to comment
Share on other sites

Servus mr-fan,

thanks for the hints. I now built the inputfield pretty much like described above. I duplicated PageListSelectMultiple for site A and changed the code so it loads JSONP data from site B. On site B I have a simple API that returns data suitable for ProcessPageList. Needs more testing but seems to work so far.

Thanks,

thomas

  • Like 2
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...