根据文章的categoryID设置页面的ItemID
这是我在类别中添加一些未通过菜单项链接的文章的情况
...当我使用 JCE 从另一篇文章链接到这些文章时,显示的页面的菜单 ID 设置为我的菜单 ID链接来自...这是完美的,面包屑按预期工作,一切都很好...
问题是当我执行搜索时...当结果返回时,那些没有菜单项的链接文章返回时没有菜单项itemID
我想知道是否有办法修改 Joomla Router 来设置没有 ItemID 的页面的 ItemID(如果它们与某些 catID 匹配)...
我知道我将修改核心文件...我无法创建隐藏菜单项,因为这会干扰面包屑导航...该网站有大量类别,因此为每个类别创建菜单项将是痛苦的!
非常感谢您的帮助。
Here is the situation
I am adding some articles within a category that are not linked by a menu item ... when I use JCE to link to these articles from another article, the menu ID of the page displayed is set to the one I am linking from ... This is perfect, the breadcrumbs are working as expected and everything is fine ...
The problem is when I perform a search... when the results return, those linked articles which has no menu item comes back with no itemID
I was wondering if there's a way to modify Joomla Router to set an ItemID for the pages which has no ItemID if they match certain catID ...
I know I will be modifying the core files ... I cannot create hidden menu items because this will disturb the breadcrumbs navigation... The site has huge number of categories so creating menu item for each will be painful!
Thanks a lot for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您当然可以修改路由器来查找特定文章的 catID,但除非该类别有相应的菜单项,否则它不会完成任何操作。 itemID 具体来自 itemID,因此必须有一个与其相关的菜单项才能成为有效的 itemID。
您可以修改搜索表单以传递当前的 itemID,但如果您的搜索显示在每个页面上,则它会根据搜索启动的位置而有所不同。
如果您的所有内容项都可以使用相同的 itemID,您可能只想对搜索结果使用覆盖并将该特定 itemID 添加到所有搜索结果中。
如果您不想创建菜单项,恐怕没有简单的答案。
You could certainly modify the router to look up the catID for a particular article, but it would not accomplish anything unless that category has a corresponding menu item. itemID specifically comes from the itemID so there must be a menu item related to it in order for it to be a valid itemID.
You could modify your search form to pass along the current itemID, but if your search shows up on every page, it would vary depending on where the search was initiated.
If all of your content items can use the same itemID, you might want to simply use an override for your search results and add that particular itemID to all your search results.
I am afraid that there is no simple answer if you do not want to create menu items.