Jump to content

[CLOSED] $pages in multi-site setup


joeck
 Share

Recommended Posts

Hi Everyone,

I was playing around with the ProcessWire command-line script sitemap.sh (https://processwire.com/docs/front-end/include/)

I currently have a multi-site setup (with separate databases).
-> site
-> site-other

The sitemap works but it shows only the pages from the default site directory. How can I get the sitemap of the site-other directory?

Here is my working code that prints the sitemap of 'site':

#!/usr/bin/php
<?php namespace ProcessWire;
include("index.php"); // bootstrap ProcessWire
function listPage($page, $level = 0) {
  echo str_repeat("  ", $level) . $page->title . "\n";
  foreach($page->children as $child) {
    listPage($child, $level+1);
  }
}
listPage($pages->get("/")); // start at homepage

I tried including index.config.php instead of index.php but that didn't help...

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...