HTL 语言、字符串连接和三元运算符
HTL Language, string concatenation and ternary operator
我正在使用 adobe AEM 和 HTL 语言。我正在写类似的东西:
${properties.hash ? [model1.href,properties.hash] @ join='#' : model1.href}
但是不起作用。我认为这是语法问题。但我无法解决问题。
@
三元表达式中的标记在此处不是有效标记。您可以将 @join
移动到表达式的末尾。
${properties.hash ? [model1.href,properties.hash] : model1.href @ join='#'}
@join
不会影响简单字符串,保持原样,如果 properties.hash
是 false
我正在使用 adobe AEM 和 HTL 语言。我正在写类似的东西:
${properties.hash ? [model1.href,properties.hash] @ join='#' : model1.href}
但是不起作用。我认为这是语法问题。但我无法解决问题。
@
三元表达式中的标记在此处不是有效标记。您可以将 @join
移动到表达式的末尾。
${properties.hash ? [model1.href,properties.hash] : model1.href @ join='#'}
@join
不会影响简单字符串,保持原样,如果 properties.hash
是 false