Answer the question
In order to leave comments, you need to log in
The standard Joomla search does not work on the homepage (with &Itemid=101), but works without "&Itemid=101". How to fix?
Version of Joomla: 3.4
I display the search through the standard module for all pages.
if you enter "word" on the main site.ru, then the URL will be:
http://site.ru/component/search/?searchword=слово&searchphrase=all&Itemid=101
http://site.ru/component/search/?searchword=слово&searchphrase=all
http://site.ru/component/search/
http://site.ru/component/search/?searchword=слово&ordering=newest&searchphrase=all
if (isset($items[0]))
{
$searchUri .= '&Itemid=' . $items[0]->id;
}
if (isset($items[0])) {
if ($items[0]->id != 101) { /* remove "Itemid=101" from url for main page */
$searchUri .= '&Itemid=' . $items[0]->id;
}
}
var url = window.location.href;
if(url.indexOf("&Itemid=101") > -1) {
url = url.replace("&Itemid=101", "");
window.location.replace(url);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question