在 ExpressionEngine 1.6.x 中清理标题 URL
我运行一个博客,其中博客标题是外部链接或内部链接,指向较长的文章,类似于您在类似博客上看到的内容。由于某种原因,ExpressionEngine (1.6.x) 不执行任何操作来清理所提供的 URL 中的“&”符号等内容。
我在正文中使用 Markdown,这似乎在清理所有 URL 方面做得很好。然而,ExpressionEngine 自己对标题的处理并没有解决这个问题。我曾尝试在 Markdown 中格式化“标题 URL”,但失败得很惨,该死的,如果我知道 ExpressionEngine 中到底是什么阻止了我使用它。
因此,问题归结为其他 ExpressionEngine 1.6.x 用户做了什么和已经做了什么,或者是否有人可以想出一个 MacGyver 式 解决方案。因为我已经被困了半年多了。
I run a blog where the blog title is either an external link or an internal link to a longer piece similar to what you’ve seen on similar blogs. For some reason, ExpressionEngine (1.6.x) does nothing to sanitize such things as ampersands in the URLs provided.
I use Markdown in the body text, which seems to do a great job of sanitizing all URLs. Yet, ExpressionEngine’s own handling of the titles doesn’t cut it. I have tried formatting the “title URLs” in Markdown and failed miserable, and damn if I know what the hell it is in ExpressionEngine that prevents me from using it.
So the question boils down to what other ExpressionEngine 1.6.x users do and have done, or whether someone can come up with a MacGyver-esque solution. Because I’ve been stumped upwards of half a year.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
EllisLab 的 Rick Ellis 的用于 EE1 的 XML Encode 插件将转换您的特殊字符到 HTML 实体。
该插件最初设计用于将保留的 XML 字符转换为 ExpressionEngine RSS 模板中的 HTML 实体,但应该可以满足您的需要。
要使用该插件,请将您的
{title_link}
自定义字段包含在其标记对之间:这将导致:
http://www.google.com/search?q=nytimes&btnG =Google+Search
正在转换为:
http://www.google.com/search?q=nytimes&btnG=Google+Search
其他 EE1 插件,提供更相似但高级功能是 Cleaner by utilitEEs (Oliver Heine) 或 Low Replace 作者:Lodewijk Schutte。
The XML Encode Plugin for EE1 from Rick Ellis of EllisLab will convert your special characters to HTML entities.
The plugin was originally designed to convert reserved XML characters to HTML entities in the ExpressionEngine RSS templates, but should work for what you need.
To use the plugin, wrap your
{title_link}
custom field in between its tag pairs:This would result in:
http://www.google.com/search?q=nytimes&btnG=Google+Search
Being converting into:
http://www.google.com/search?q=nytimes&btnG=Google+Search
Other EE1 Plugins which offer more similar but advanced features are Cleaner by utilitEEs (Oliver Heine) or Low Replace by Lodewijk Schutte.