2

I am using URLUtils to generate URL's for a languages selector as per the documentation. However I want to use the current URL so that a redirect will go to the same page in a different locale. The example in the document has a hardcoded "Home-Show" action:

<a class="" href="${URLUtils.http(new dw.web.URLAction('Home-Show',dw.system.Site.getCurrent().getID(),locale))}"><isprint value="${localeLanguage}"></a>

Is there a way to get the current action including any url paramters, or will this requires a custom function to extract this.

1

You can fetch the current URL as follows, if you are not using SFRA:

pdict.CurrentSession.clickStream.last.referer

Otherwise, you can get the clickStream from the session in SFRA.

Does this solve your issue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.