Remove Article ID from Joomla 3 url(从 Joomla 3 url 中删除文章 ID)
问题描述
我正在尝试从 Joomla 3 URL 中删除文章 ID.我四处搜索,结果在
I am trying to remove article id from Joomla 3 URL. I searched around and the response is in
组件com_content outer.php
componentscom_content outer.php
将 0 更改为 1$advanced = $params->get('sef_advanced_link', 1);
在第 38 和 290 行
on lines 38 and 290
并注释掉
if (strpos($segments[0], ':') === false) {$vars['view'] = '文章';$vars['id'] = (int)$segments[0];返回 $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?
推荐答案
您可以通过修改 com_content 行中的 com_content 行,而不是在文件系统中进行并修改 Joomla 核心>extensions 表如下所述:http://www.itoctopus.com/how-to-remove-the-article-id-from-joomlas-sef-urls(该 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 url 中删除文章 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 Joomla 3 url 中删除文章 ID
基础教程推荐
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
