How to add selectors using sightly to an url. | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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 -->

 

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
April 12, 2024

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