thomas Posted August 31, 2015 Share Posted August 31, 2015 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 More sharing options...
mr-fan Posted August 31, 2015 Share Posted August 31, 2015 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 1 Link to comment Share on other sites More sharing options...
thomas Posted September 3, 2015 Author Share Posted September 3, 2015 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 2 Link to comment Share on other sites More sharing options...
bernhard Posted September 3, 2015 Share Posted September 3, 2015 hi thomas, how do you manage access control on site B? in other words, how does site B know what it is allowed to return to the user of site A? or is it all public data? thanks Link to comment Share on other sites More sharing options...
thomas Posted September 3, 2015 Author Share Posted September 3, 2015 Hi Bernhard, since it's a product cataloque and all that's needed in site A is the products I simply restrict site B's API to the products folder and it's children. Link to comment Share on other sites More sharing options...
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