getItems('link', 'index.php?option=com_search&view=search'); if(isset($items[0])) { $post['Itemid'] = $items[0]->id; } unset($post['task']); unset($post['submit']); $uri = JURI::getInstance(); $uri->setQuery($post); $uri->setVar('option', 'com_search'); $this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')), false)); } }