我有一个菜单链接到 Joomla 中的“单篇文章”。
因此,面包屑是:主页 > 服务
现在,我创建了一篇要放入服务页面的文章。例如“开发服务”页面。
所以,我转到“服务”页面并创建到该页面的链接,现在导航栏是:主页 > 服务 > 未分类 > 开发服务
如何只放首页 > 服务 > 开发服务
有什么技巧吗?
最佳答案
在 Joomla Forum 找到了一些适合您的解决方法, 但考虑到 How to override the component mvc from the Joomla! core 中所述.这实际上隐藏了面包屑中的类别,但仅当 $this->item->catid
为 0 时,才可以很容易地进行修改。
你想要的改变在:components/com_content/views/article/view.html.php
$category = JCategories::getInstance('Content')->get($this->item->catid);
while ($category && ($menu->query['option'] != 'com_content' || $menu->query['view'] == 'article' || $id != $category->id) && $category->id > 1)
{
$path[] = array('title' => $category->title, 'link' => ContentHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
关于php - Joomla 面包屑显示 "Uncategorized"类别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11249917/