我試圖讓expressionengine檢查一個單詞的通道字段,如果找到該單詞,它將顯示另一個字段的內容。ExpressioneEngine包含運算符不起作用
在這種情況下,我希望它爲「志願者」一詞搜索{links-title},如果找到「Volunteer」這個詞,它會顯示{links-branch}的內容。
這裏是我想要使用的代碼:
{exp:channel:entries channel="locations-links"}
{if links-title *= "Volunteer"}
{links-branch}
{/if}
{/exp:channel:entries}
本頁面:https://ellislab.com/expressionengine/user-guide/templates/conditionals.html#contains-operator說,包含運營商* =但是當我使用它時,頁面顯示完全空白。從字面上看,這個操作員似乎不起作用。如果我使用==它可行,但在這種情況下,{links-title}必須完全是「志願者」,沒有別的。
任何人都知道這是怎麼回事?
在[EE 2.9]中添加了「contains」運算符(https://ellislab.com/expressionengine/user-guide/about/changelog.html#version-2-9-0) 。你正在運行什麼版本? – AllInOne