Created
March 18, 2015 13:56
-
-
Save Renobird/2d59aa36ed902b9d91e4 to your computer and use it in GitHub Desktop.
Show part of ProcessWire page tree based on domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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