0

に応じて、フォルダーからいくつかの画像を表示する必要があります{{ name }}

ファイルの名前は次のようになります。

  • foo.jpg
  • foo_blur.jpg
  • bar.png
  • bar_blur.png

次に、ぼやけた画像で何かをする必要があります。これは私が試したものですが、成功しませんでした:

{{ files:listing folder='1' }}
    {{ if { helper:strpos haystack='[[ name ]]' needle='_blur' } }}
        {{ files:image id='{{ id }}' }}
    {{ endif }}
{{ /files:listing }}

現在、それは何もしません。strpos必ず返品されるようですfalse。私が間違っていることはありますか?

4

2 に答える 2

0

の場合と同じ中括弧をname変数に使用する必要がありますid

{{ files:listing folder='1' }}
    {{ if { helper:strpos haystack='{{ name }}' needle='_blur' } }}
        {{ files:image id='{{ id }}' }}
    {{ endif }}
{{ /files:listing }}
于 2013-09-24T23:29:50.007 に答える
0

レオン・スタッフォードのおかげで、自分でそれを手に入れました:

ブラケット[[ ]] その周辺を取り外すだけですquotes

{{ files:listing folder='1' }}
    {{ if { helper:strpos haystack=name needle='_blur' } }}
        {{ files:image id='{{ id }}' }}
    {{ endif }}
{{ /files:listing }}
于 2013-09-24T23:37:41.093 に答える