2016-11-02 113 views
1

我正在使用adobe AEM和HTL語言。我正在寫這樣的東西:HTL語言,字符串連接和三元運算符

${properties.hash ? [model1.href,properties.hash] @ join='#' : model1.href} 

但是不起作用。我認爲這是一個語法問題..但我無法解決問題。

回答

1

@三元表達式中的令牌在此處不是有效的令牌。您可以將@join移至表達式結尾。

${properties.hash ? [model1.href,properties.hash] : model1.href @ join='#'} 

@join不影響簡單的字符串,葉,因爲它是,這情況下,如果properties.hashfalse