Jump to content

How to save a new page to a multi-instance website?


Marc
 Share

Recommended Posts

I have setup two websites, A and B. A can read pages from B using the multi-instance API. But how do I get A to save a new page to B? I have this simple test setup:

$path = "C:/Users/Marc/Documents/development/www/siteB/";
$url = "/siteB/";

$siteB = new ProcessWire($path, $url);

$np = new Page();
$np->template = "my-template";
$np->parent = $siteB->pages->get('/forms/');
$np->title = 'test multi-instance form';
$np->save();

The page is saved to site A instead of B, with no parent. Is this a case of saving it to the wrong instance? If so, how do I save it to the correct instance (site B)?

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