添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
内向的杯子  ·  javascript - 记 · ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I want to check if my URL does not contains certain word and depends on this criteria want to change meta url tag. Here is what I do

<#if theme_display.getURLCurrent()?contains("word")>
    <#else>
    <meta property="og:url" content=........... />

But it seems not very cool, any one know if there is an opposite of contains in freemarker? Something like ?notcontains("word")

Could you explain what's the problem with this? what if you using theme_display.getURLCurrent()?contains("word") == false expression as far as I see !theme_display.getURLCurrent()?contains("word") should be negated? – golddragon007 May 17, 2019 at 9:54 yes i was looking for this theme_display.getURLCurrent()?contains("word") == false . Thanks – Test Testo May 17, 2019 at 11:33
<#if theme_display.getURLCurrent()?contains("word") == false>
<meta property="og:url" content=........... />
<#if !theme_display.getURLCurrent()?contains("word")>
<meta property="og:url" content=........... />
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.