我知道这是一个老帖子,但我发现这个有一个简单的解决方案使用Joomla 1.6,并想分享它。这是一个核心黑客,它不是最佳的,因为它在升级过程中会消失,但它很容易做到。
像我这样的人一直在寻找的是允许用户在页面上的搜索框中输入文本,并将结果显示在模板内的空白页面上,而不是让结果显示在相同的页面以及其他内容,或者被迫使用菜单项将用户发送到单独的搜索页面。
当在Joomla!中使用搜索框时,页面来启动搜索,它是正在使用的搜索的“组件”部分 - 而不是“模块”。搜索组件控制器中有一部分设置用于菜单的ID,或自动设置结果来自并显示在请求页面中。我们只需要关闭它就可以将搜索结果发送到空白页面。
所以,在/components/com_search/controller.php - 注释掉下面的代码:
/* // set Itemid id for links from menu
$app = JFactory::getApplication();
$menu = $app->getMenu();
$items = $menu->getItems('link', 'index.php?option=com_search&view=search');
if(isset($items[0])) {
$post['Itemid'] = $items[0]->id;
} else if (JRequest::getInt('Itemid') > 0) { //use Itemid from requesting page only if there is no existing menu
$post['Itemid'] = JRequest::getInt('Itemid');
}
*/
这将显示你的模板的空白页的内容部分内的搜索结果。至少它为我做了。
仍然没有运气...更改甚至没有反映在页面 – ria 2010-03-03 09:09:32
我通过更新对joomla15/templates/TemplateName/html/mod_search/default.php文件的更改来解决此问题。现在我在新页面上看到结果。 我如何设置此页面以使用特定的joomla模板,而不是默认设置? – ria 2010-03-03 09:30:48
您可以添加到default.php自定义CSS样式。可能,本教程可以帮助您: http://www.learnwebdesignonline.com/cms/customizing-joomla-templates.htm http://joomlablogging.wordpress.com/2008/02/10/giving-your-joomla -blog-section-a-different-template/ – xaoc 2010-03-03 17:29:14