Multisite Shared Pages

Hi, I’ve been experimenting with a Multisite configuration, is there a way to have pages that can be shared among all the sites or selected sites in the installation? Thanks

One of the uses of Universal Content Puller is to show an area of one page within another page. This can be done by specifically selecting a page to pull from, or by an ancestor relationship. Example of sharing sidebars at Example - Common Sidebar :: c5Magic

What about single pages? This must be possible - the login and register pages appear on multisite installs. I’d really like to know how to get other single pages such as /cart and /checkout etc to appear in multisite installs. At the moment these pages only appear in the master site tree. The page controller needs to be in the “right” place for these pages to function.

Try copying them from the default domain to the second domain using the 2-up sitemap view. Put them in the same location as the default site, if that works those copied pages will probably still have the default theme set on them, you need to change that manually.

Thanks - that does seem to work, but it doesn’t seem entirely correct to me.

Digging a bit deeper, I note that pages such as /login have the value 0 in the Pages table for siteTreeID and cParentID, so I thought I’d try setting the /cart page to the same (original values are 1). Lo and behold the cart page no longer appears in the site map unless you view system pages, but more importantly it now works on every site.

$db = Database::Connection();
$pages = [
	['/cart.php', 0, 0],
	['/checkout.php', 0, 0],
];
foreach ($pages as $record) {
    $db->executeQuery('update Pages set siteTreeID = ?, cParentID = ? where cFilename = ?', [$record[1], $record[2], $record[0]]);
}

$pages = [
	['/checkout/complete.php', 0],
];
foreach ($pages as $record) {
	$db->executeQuery('update Pages set siteTreeID = ? where cFilename = ?', [$record[1], $record[2]]);
}

@jero I think in your last executeQuery $record[2] should really be $record[0]

Also does setting cParentID to 0 mean the page can only be at the root in this scenario? Never a sub page?

@mnakalay yes, you’re right. I made the mistake of applying the first query to the checkout/success page, but because this is a subpage it needs the cParentID to remain unchanged. It’s only the siteTreeID that needs to become 0.

In response to the subpage question, I guess I indirectly answered that with the above. checkout/success is a sub-page, and it works just fine. It’s no different from the three pages that are subpages of /account.