contao CMS - 我不明白链接系统
我有一个问题,因为我不理解 contao 中的链接系统(http://demo.contao.org/) 但不仅在这个 CMS 中,你能帮助我吗? 所以: 我们始终有链接: www.something.xx/title-for-example-news.htm
,
扩展名始终为htm
(绝不是php
!),不有新闻的ID,这是一个好的解决方案吗?它是如何运作的?
我知道我们有一个链接,例如www.sometking.xx/321-title-for-example-news.htm, 其中 321 是 id 新闻,因此我们可以从数据库中轻松快速地获取日期,并且不会发生冲突。
在 contao 情况下它是如何工作的?快吗?也许是静态路由数组?你对此有何看法?看起来很漂亮,但是速度快吗?
I have a problem because I dont't understand system of links in contao (http://demo.contao.org/) but not only in this CMS, Can you help me?
So:
We ALWAYS have link as:www.something.xx/title-for-example-news.htm
,
And the extension is always htm
(never php
!), no have id of e.g news, is it a good solution? How does it work?
I know way that we have a link for example www.sometking.xx/321-title-for-example-news.htm,
where 321 is id news so we can get easy and fast date from e.g. database, and no colision.
How does it work in contao case? it is fast? Maybe static array of routing? What do you think about it? It looks very pretty but is it fast?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
偶然发现你的问题。如果您仍然感兴趣,就来吧。
它与包含 id 的链接一样快。这两个系统都是通过在数据库中查找页面名称或 ID 来工作的。 contao 将永久链接存储在 tl_page 的别名列中。
如果您更改页面名称/别名,则会出现问题:如果未找到别名,contao 不会回退到 id,因此浏览旧页面名称会返回 404。这与 Wordpress 等不同。即使您更改页面或帖子的名称,Wordpress 也永远不会更改永久链接。毕竟,PERMAlink 永远不应该改变!
Just came across your question by chance. If you're still interested, here you go.
It's just as fast as the link with the id included. Both systems work by looking up the page name or id in the database; contao stores the permalink in the alias column of tl_page.
There is an issue if you alter the page name / alias though: contao does not have a fallback to the id if the alias is not found, so browsing the old page name returns a 404. This differs from Wordpress, for example. Wordpress will never changes the permalink even if you change the name of the page or post. After all, a PERMAlink should never change!