Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Url rewriting issue

Vote:
 

Is anyone aware of any Url rewriting that could be taking place within the Commerce Framework that would be removing the ID parameters from PageData.LinkURL?

To create a link to a product page I have to use the LinkURL property of the page I want to go to, then I append the Commerce Catalog Entry Code property, eg.  "ec=1234"

When I add this to the value returned by LinkURL and ouput to the link on the page, once the page is fully rendered something has completely stripped out the id parameter and i'm left with the following:

http://localhost/Templates/Commerce/Pages/BooksDetails.aspx?epslanguage=en&ec=5468

This will then break the PageType (using PageTypeBuilder) as no id is specified.  if you manually add the id to the url just so the page works, it still gets stripped out again on any kind of postback.

Any help would be great - also, would be good if some people from EPiServer started having a bit more involvement in the Commerce forum posts - the documentation for development on this new platform is pretty thin lets face it.

Thanks

#52678
Aug 09, 2011 15:11
Vote:
 

This seems to be more of a CMS issue than a Commerce issue. What kind of URL rewriter do you have enabled? And how do you create the link? If you try to do the same thing in edit mode, do you still get the same kind of behavior? Also, what version of Commerce are you using?

#52680
Aug 09, 2011 16:53
Vote:
 

I've got a support query going through at the moment which includes logs and sample code etc.  I'll update this post as soon as we get to the bottom of it.  Yes it seems like a CMS issue, accept the same code works fine in CMS instances as i've used it for many years.  Using Commerce 1.0 R2, its a configuration nightmare so i'm wondering if there is something hidden away in the depths of it.  As the documentation is pretty poor, its hard to get to the bottom of.

#52722
Aug 10, 2011 16:47
Vote:
 

Support didn't really get to the bottom of it - but the following code seems to work:

 

UrlBuilder internalurl = new UrlBuilder(pageData.LinkURL);

EPiServer.Global.UrlRewriteProvider.ConvertToExternal(internalurl, null, System.Text.Encoding.UTF8);

internalurl.ToString() + "?ec=5468";

 

if you add the 'ec' parameter at any other point, you don't get the friendly url and then something strips out the 'id' parameter. 

 

#52859
Aug 17, 2011 14:58
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.