Custom Url Routing

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
FirstDivision
Ensign (ENS)
Ensign (ENS)
Posts: 12
Joined: Thu Jan 31, 2013 4:53 pm

Custom Url Routing

Post by FirstDivision » Fri Feb 01, 2013 3:06 pm

I've been integrating Able with a custom CMS and have another question. This time about custom urls.

I've gotten our CMS to pass processing of the "normal" product URLs to Able, but so far can't get the custom urls to behave the same way.

So, for example, if I have myproduct, the Able-generated URL will be myproduct.aspx, and the CMS will pass that to Able which will render fine. But if I create a custom url for this product, "mycustomurl.aspx", Able will deliver it fine, but the CMS (which has the Able assemblies loaded) doesn't seem aware of it and tries to load it itself.

Can someone explain how the routing of custom URLs is different from regular product urls that would cause this? Is there some configuration (in web.config or elsewhere) that I haven't added to my CMS that would enable this behaviour?

Thanks,
Andrew

FirstDivision
Ensign (ENS)
Ensign (ENS)
Posts: 12
Joined: Thu Jan 31, 2013 4:53 pm

Re: Custom Url Routing

Post by FirstDivision » Mon Feb 04, 2013 1:57 pm

I've made a little more progress on my own, but let me try to explain this a little better what my goal is:

We have an in-house CMS that works great for traditional CMS stuff, templating, extensionless urls, etc...but we need to add ecommerce capabilities to it, so we're trying to make the two work together as seamlessly as possible. So far:
  • Referenced Able assemblies and copied over relevant web.config / app_data sections
  • Copied over ConLib ascx controls (without code-behinds), and a few of the base able pages like product.aspx, basket.aspx
The in-house CMS has its own ascx package, so I was able to create an ascx that acts as a wrapper for ConLib controls. The HtmlContainer is the most promising because it can parse ScriptLet, but we've also been able to build a wrapper for FeaturedProductsGrid.ascx, so that is possible I think if it had to be.

We can show the featured products, the basket contents (via basket.aspx), and product pages (via either product.aspx or some other magic routing that happens with a custom url).

The part I'm stuck on is getting the ProductPage control to run inside a CMS page. This is because the product page control is:
  • Made of quite a few separate controls
  • All these controls that need a product ID do so via PageHelper.GetProductId()
  • That lookup happens very early in the control's lifecycle (Page_Init, which I think is the first event in a User Control's life. From what I've seen User Controls do not have a PreInit)
So what I really need to figure out is how to:
  • Load a product in code from its CustomUrl
  • Prevent (OR take advantage of) whatever Able does to route CustomUrls....this doesn't appear to hit Product.aspx?
  • Somehow pass that product / id to the ascx control that will be running in the CMS and not Able
If I can get the first one above, that'll help a a lot I think to getting the second one solved.

Post Reply