Custom search and default search conflict
Permalink
I have a block which overrides the default search block and it works fine by itself. But if I add the default block on the same page as well they start conflicting. I suspect because both use the same variables and functions.
The search is done based on the 'query' variable's value. Both blocks have this same variable and this is one of the conflicts. I tried changing all 'query' names in the controller.php and view.php to something else but it didn't work.
Are there any other files relying on this variable?
Also, in my custom search block I display the results by
and it's another conflict as the default search relies on the same function but it's different:
Is there any other simpler way to show a list of found pages?
Thank you.
The search is done based on the 'query' variable's value. Both blocks have this same variable and this is one of the conflicts. I tried changing all 'query' names in the controller.php and view.php to something else but it didn't work.
Are there any other files relying on this variable?
Also, in my custom search block I display the results by
$res = $this->getSearchPage($pl->getPage()); ... foreach($res as $r) { if($r['length'] == $length and $r['continent'] == $continent and $r['adventure'] == $adventure and $r['interest'] == $interest){ $results[] = new IndexedSearchResult($r['cID'], $r['cName'], $r['cDescription'], $r['score'], $r['cPath'], $r['content'], $r['length'], $r['continent'], $r['adventure'], $r['interest']); } } ... public function getSearchPage($p) { $results = array(); foreach($p as $c) { $results[] = array('cID' => $c->getCollectionID(), 'cName' => $c->getCollectionName(), 'cDescription' => $c->getCollectionDescription(), 'score' => $c->getPageIndexScore(), 'cPath' => $c->getCollectionPath(), 'content' => $c->getPageIndexContent(), 'length' => $c->getAttribute('length'), 'continent' => $c->getAttribute('continent'), 'adventure' => $c->getAttribute('adventure'), 'interest' => $c->getAttribute('interest')); } return $results; }
and it's another conflict as the default search relies on the same function but it's different:
$res = $ipl->getPage(); foreach($res as $r) { $results[] = new IndexedSearchResult($r['cID'], $r['cName'], $r['cDescription'], $r['score'], $r['cPath'], $r['content']); }
Is there any other simpler way to show a list of found pages?
Thank you.
for this
and now I can use both blocks on the same page without any conflict.