Skip to content

Instantly share code, notes, and snippets.

@hissy
Created January 27, 2013 07:39
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/4647258 to your computer and use it in GitHub Desktop.
Save hissy/4647258 to your computer and use it in GitHub Desktop.
[concrete5] Hardcoded Search block only search in current language site tree
<?php
Loader::model('section', 'multilingual');
$ms = MultilingualSection::getCurrentSection();
if (is_object($ms)) {
$lang = $ms->getLanguage();
$search = BlockType::getByHandle('search');
$search->controller->title = t('Site Search');
$search->controller->buttonText = t('Search');
$search->controller->baseSearchPath = $ms->getCollectionPath();
$search->controller->searchUnderCID = $ms->getCollectionID();
$search->controller->resultsURL = '/' . $lang . '/search';
$search->render('view');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment