Skip to content

Instantly share code, notes, and snippets.

@Renobird
Created March 18, 2015 13:56
Show Gist options
  • Save Renobird/2d59aa36ed902b9d91e4 to your computer and use it in GitHub Desktop.
Save Renobird/2d59aa36ed902b9d91e4 to your computer and use it in GitHub Desktop.
Show part of ProcessWire page tree based on domain
<?php
class ProcessPageListSubDomains extends Process{
public static function getModuleInfo() {
return array(
'title' => 'Custom Page List to show only part of the the page tree',
'summary' => 'List pages in a hierarchal tree structure',
'version' => 100,
);
}
public function execute(){
$list = $this->modules->get("ProcessPageList");
$host = $this->config->httpHost;
switch ($host) {
case 'somedomain.com':
$list->set('id',12345); // parent pageID for the subdomain
break;
case 'otherdomain.com':
$list->set('id',67890); // parent pageID for the subdomain
break;
default:
# code...
break;
}
return $list->execute();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment