コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.
解決済み

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

Avatar

Level 7

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=’’}

 

トピック

トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。

1 受け入れられたソリューション

Avatar

正解者
Community Advisor

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

MS-29LinkedIn

元の投稿で解決策を見る

4 返信

Avatar

正解者
Community Advisor

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

MS-29LinkedIn

Avatar

Community Advisor

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

Avatar

Level 2

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!
 

Avatar

Level 1

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