Jump to content

Access another PW instalation


matjazp
 Share

Recommended Posts

I would like to have access to another site running PW on the same server from my templates (and modules). I would like to use PW APIs, from both "servers", something like:

$pages->find(some_selector) would find pages in "local" PW

$pages_remote->find(some_selector) would find pages in "remote" PW

 
Is it possible?
Link to comment
Share on other sites

Hi matjazp, this is possible with the Pages Web Sevice. You can do anything with this web service that you would do with a $pages->find() call. This module essentially provides a safe front-end to the AJAX API provided in the ProcessPageSearch module, enabling that capability to be used outside of the admin.

  • Like 3
Link to comment
Share on other sites

In pw 3.0 (still in alpha) there will be the ability to call your other instance of processwire directly from the api. What exactly are you trying to accomplish, there may be another method that may end up suiting your problem that some could help suggest, as I am sure you have noticed there are some really smart friendly people here like that guy ^^   :)

Link to comment
Share on other sites

I (client) might want to display news posts from remote site on his site. I could connect to remote mysql and use db queries (hmm...no). I could parse rss feed (then you have it all and not just what client needs). I know PW 3 runs in its own namespace, but believed something similar might be possible with current PW. Pages Web Service will do the job, will use it if client expresses a wish.

Thanks to really smart friendly people here ;-)

  • 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...