Developer forum

Forum » Development » Get userfriendly URL for eCom product using API?

Get userfriendly URL for eCom product using API?

Sten Hougaard
Reply

Hi,

Is there an API call which will give me the calculated userfriendly URL for a given product on a given page?


Med venlig hilsen/Best regards,

Sten Hougaard
Webudvikler

A: København/Aarhus . W: www.1stweb.dk
@: netsi1964


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Sten,

You can do something like Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=7&ProductID=PROD1001") to do that.

- Jeppe

Votes for this answer: 1
 
Sten Hougaard
Reply

Hi Jeppe,

I have a solution where I have setup customized URLs (here is part of Customized URL settings):

but I only get the same URL back as I pass the to the GetFriendlyUrl method, for instance:

Default.aspx?ID=1565&ProductID=107340

Solution info:

Content version     20.3.1.14
Assembly versions    Dynamicweb.dll 8.4.0.16


Med venlig hilsen/Best regards,

Sten Hougaard
Webudvikler

A: København/Aarhus . W: www.1stweb.dk
@: netsi1964

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

If you type that url into the address bar of the browser, are you then transferred correctly to the friendly url?

Votes for this answer: 1
 
Sten Hougaard
Reply

Hi Jeppe,

You are right! :-) Me bad! - It was a matter of the ID which I gave it, it was the wrong ID. Changing that made your solution work perfectly! 

Thank you!


Med venlig hilsen/Best regards,

Sten Hougaard
Webudvikler

A: København/Aarhus . W: www.1stweb.dk
@: netsi1964

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Glad to hear it :)

 

You must be logged in to post in the forum