All, silly question but does anyone know how I could test if path does not contain //
I tried strings other than // and it worked but not this . I used “in”
Solved! Go to Solution.
Since version 1.4, you can use in relational operator: https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#1143-relational-operators
${'//' in '//content/abc'} <!--/* returns true */-->
${'//' in '/content/abc'} <!--/* returns false */-->
Hope this helps!
Thanks!
Hi @NitroHazeDev ,
Please try like below.
<sly data-sly-test.isDoubleSlashContain="${'//' in '/content//test'}"/> <div data-sly-test="${!isDoubleSlashContain}"> //your code </div>
Thanks @Asutosh_Jena_ and @Kishore_Kumar_ . I tried the in operator with the //, worked great but was trying to use a ! operator with it, as below.. what do you think i could be missing? I wanted a single line check rather than assigning to a variable and checking
${!'//' in '//content/abc'}
Thank you @Kishore_Kumar_ . Much appreciated. That helped
Views
Likes
Replies
Views
Likes
Replies