【问题标题】:Unable to link to an external url (Bolt cms)无法链接到外部 url (Bolt cms)
【发布时间】:2017-12-30 09:33:50
【问题描述】:

我正在使用 Bolt CMS,并且正在尝试创建指向外部网站的链接。

所以我从内容类型获取记录(这可行),但是当我尝试使用 href 链接到此记录时,我的域被添加到 url 中。

无论我做什么,我都无法链接到外部网站。

<a href="{{ record.contentlink }}">Link</a> 

链接到“mydomain.com/www.externalurl.com”,而我只想被定向到 www.externalurl.com。

我希望解决方案非常简单,但到目前为止我还没有找到答案...... 感谢您的帮助!

【问题讨论】:

    标签: twig href bolt-cms contenttype


    【解决方案1】:

    试试

    <a href="http://{{ record.contentlink }}">Link</a> 
    

    只要您在 record.contentlink 中没有“http://”,它就应该可以工作

    【讨论】:

    • 你说得对!好的 thx 很多,这行得通。然而另一个问题出现了:当编辑器在记录中写入'http://' 时,'http//' 与':' 一起打印。你知道为什么会这样吗?
    猜你喜欢
    • 1970-01-01
    • 2010-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多