Developer forum

Forum » Development » Alternative for SearchEngineFriendlyURLs when using new URL providers?

Alternative for SearchEngineFriendlyURLs when using new URL providers?

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

When I set up the following under Custom URLs:

a call like this:

Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=123&ProductID=101244");

gives me the friendly bit for the page part, but not for the product.

I was told we have to leave this setting to None to solve some other issues, so I was wondering if there's an alternative API method to call to convert ProductID=101244 to a product name?

Imar


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Swift solution?

These settings belong to the 'old' aka 'classic' friendly URLs. And not the new URL aka UrlHandlers that are configured on a page, i.e. Product page in Swift:

Your URL is Default.aspx?ID=123&ProductID=101244 - meaning it does not have a groupid - that will not work with the new URL system as it will always use groupid (primaryordefault for the shop) and use the group settings to remove group name as part of the URL if it is not wanted. So in that case you need Default.aspx?ID=123&GroupID=G123&ProductID=P123[&VariantID=VO1]

Both URL systems should work with GetFriendlyUrl - so that part should work.

What other settings do you have in your URL settings? It can be a products not in curren website shop or something like that?

 

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Ah, adding GroupID did the trick. That wasn't in the original channable XSLT template, so that's why I didn't have it.

Thanks!

Imar

 

You must be logged in to post in the forum