Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to add selectors using sightly to an url.

Avatar

Level 3
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Please check below

https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md

addSelectors - adds the provided selectors (selectors string or selectors array) to the URI

 

${'path/page.woo.foo.html' @ addSelectors='foo.bar'}
<!-- outputs: path/page.woo.foo.foo.bar.html -->

${'path/page.woo.foo.html' @ addSelectors=['foo', 'bar']}
<!-- outputs: path/page.woo.foo.foo.bar.html -->

  • query - adds, replaces or removes the query segment of a URI, depending on the contents of its map value

  • addQuery - adds or extends the query segment of a URI with the contents of its map value

${'http://www.example.org/search?s=1' @ addQuery=jsuse.query, context='uri'}
<!-- outputs: http://www.example.org/search?s=1&q=htl&array=1&array=2&array=3 -->

 



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Please check below

https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md

addSelectors - adds the provided selectors (selectors string or selectors array) to the URI

 

${'path/page.woo.foo.html' @ addSelectors='foo.bar'}
<!-- outputs: path/page.woo.foo.foo.bar.html -->

${'path/page.woo.foo.html' @ addSelectors=['foo', 'bar']}
<!-- outputs: path/page.woo.foo.foo.bar.html -->

  • query - adds, replaces or removes the query segment of a URI, depending on the contents of its map value

  • addQuery - adds or extends the query segment of a URI with the contents of its map value

${'http://www.example.org/search?s=1' @ addQuery=jsuse.query, context='uri'}
<!-- outputs: http://www.example.org/search?s=1&q=htl&array=1&array=2&array=3 -->

 



Arun Patidar