Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Updated the search page retrieval to support multiple sites.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Dec 5, 2014
1 parent c1b8f10 commit b769a9e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions code/extensions/ExtensibleSearchExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ class ExtensibleSearchExtension extends Extension {
*
* @return ExtensibleSearchPage
*/
public function getSearchPage() {
// get the search page for this site, if applicable... otherwise use the default
return class_exists('ExtensibleSearchPage') ? ExtensibleSearchPage::get()->first() : null;
public function getSearchPage() {

if(class_exists('Multisites')) {
$site = Multisites::inst()->getCurrentSiteId();
return ExtensibleSearchPage::get()->filter('SiteID', $site)->first();
}
else {
return ExtensibleSearchPage::get()->first();
}
}

/**
Expand Down

0 comments on commit b769a9e

Please sign in to comment.