从Joomla 3网址中删除商品ID [英] Remove Article ID from Joomla 3 url
问题描述
我正在尝试从Joomla 3 URL中删除文章ID.我四处搜寻,回应位于
I am trying to remove article id from Joomla 3 URL. I searched around and the response is in
components \ com_content \ router.php
components\com_content\router.php
将0更改为1 in
$advanced = $params->get('sef_advanced_link', 1);
change 0 to 1 in
$advanced = $params->get('sef_advanced_link', 1);
第38和290行
并注释掉
if (strpos($segments[0], ':') === false) {
$vars['view'] = 'article';
$vars['id'] = (int)$segments[0];
return $vars;
}
if (strpos($segments[0], ':') === false) {
$vars['view'] = 'article';
$vars['id'] = (int)$segments[0];
return $vars;
}
我认为它在Joomla 2.5中可以正常工作,因为所有评论都提到了这一点.
I consider it works fine in Joomla 2.5 as all comments mention this.
但是在我的Joomla 3.3网站上,它无法为我完成工作.
But it does not do the job for me on my Joomla 3.3 website.
如何在不为每篇文章创建菜单项的情况下实现这一目标?
How can I achieve this without creating menu items for each article?
推荐答案
您可以通过修改extensions
表中的com_content
行来执行此操作,而不是在文件系统中进行此操作并修改Joomla核心. : http://www.itoctopus. com/如何从joomlas-sef-url中删除文章ID (该URL中描述了两种方法,即文件系统方法和数据库方法)
Instead of doing it in the filesystem and modify the Joomla core, you can do this by modifying the com_content
row in the extensions
table as described here: http://www.itoctopus.com/how-to-remove-the-article-id-from-joomlas-sef-urls (the 2 methods are described in that URL, the filesystem method and the database method)
请注意,这已经在Joomla 3.x上进行了测试,并且可以正常工作.如果它对您不起作用,那么很可能您需要清除Joomla缓存.
Note that this is tested on Joomla 3.x and it should work. If it doesn't work for you then most likely you will need to clear your Joomla cache.
这篇关于从Joomla 3网址中删除商品ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!