1

I am using adobe AEM, and the HTL language. I am writing something like:

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

But doesn't works. I think it is a syntax problem.. But I am not able to solve the problem.

Labo29
  • 117
  • 3
  • 13

1 Answers1

1

@ token in ternary expression is not a valid token at this place. You can move the @join to end of expression.

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

@join doesn't impacts simple string, leaves as it is, which would the case if properties.hash is false

Sandeep Kumar
  • 1,758
  • 1
  • 22
  • 39
  • Is there any way to do this while also having `@context='styleString'` set? ex something like this: `${properties.iconCircle ? ['background-color:', properties.iconCircleColor] : '' @ join="" @context='styleString'};` – jmona789 Nov 23 '21 at 19:46