To remove the selectors from url 'path/page.woo.foo.html" So what should be the syntax ? select two | Community
Skip to main content
JakeCham
Level 6
January 4, 2024
Solved

To remove the selectors from url 'path/page.woo.foo.html" So what should be the syntax ? select two

  • January 4, 2024
  • 3 replies
  • 3362 views

a) ${ 'path/page.woo.foo.html' @removeSelectors[‘foo,bar’]}
b) ${ 'path/page.woo.foo.html' @removeSelectors{“foo”,”bar”,”woo”}}
c) ${ 'path/page.woo.foo.html' @selectors}
d) ${ 'path/page.woo.foo.html' @selectors=’’}

 

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 Mahedi_Sabuj

Option C & D

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

https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#125-uri-manipulation

3 replies

Mahedi_Sabuj
Community Advisor
Mahedi_SabujCommunity AdvisorAccepted solution
Community Advisor
January 4, 2024

Option C & D

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

https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#125-uri-manipulation

Mahedi Sabuj
Kamal_Kishor
Community Advisor
Community Advisor
January 4, 2024

adding to this.

Options C & D -- If you want to remove all the selectors i.e foo, woo or any other value.
Options A & B -- They have incorrect syntax for given use-case due to how the quotes are provided around the selector values. If you have a scenario to remove specific selector from URL, A or B can be used provided the selector values are provided correctly i.e 'foo', 'woo' ...

Level 2
January 4, 2024

The correct syntax to remove selectors from the URL 'path/page.woo.foo.html' would be option d) ${ 'path/page.woo.foo.html' @selectors=''} by setting the selectors to an empty string. This will remove all selectors and only retain the path and filename. Options a) and b) have incorrect syntax, while option c) retrieves the selectors rather than removing them.

 
 
 
Origin Data Hope we can help you!
 
December 17, 2024

Option B & D are correct:

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