setShortName($params->get('opensearch_name', $app->getCfg('sitename'))); $doc->setDescription($params->get('opensearch_description', $app->getCfg('MetaDesc'))); // Add the URL for the search $searchUri = JUri::base().'index.php?option=com_search&searchword={searchTerms}'; // Find the menu item for the search $menu = $app->getMenu(); $items = $menu->getItems('link', 'index.php?option=com_search&view=search'); if (isset($items[0])) { $searchUri .= '&Itemid='.$items[0]->id; } $htmlSearch = new JOpenSearchUrl; $htmlSearch->template = JRoute::_($searchUri); $doc->addUrl($htmlSearch); } }