This project is read-only.

Convert classic ASP site to Orchard

Topics: Administration, Core, Customizing Orchard
Nov 22, 2013 at 8:31 AM
Edited Nov 22, 2013 at 9:46 AM

We have a website that is written in classic ASP.

The goal is to convert this site to Orchard.

Currently I am struggling a bit with widgets with shared context.
I can create a content type ProductGroup.
On the home page I have a projection that shows the product groups with first the icons and then the title of the product group.
So far so good.

When someone clicks on the title of the product group, they should be directed to a page with on the left hand side a widget with the details of the product group and in the content area I should get a projection with all ProductCategory content types. (there exists a parent-child relationship between ProductGroup and ProductCategory).
The url of this page should be where the pg stands for productgroups and ftth is the slug of one of the product groups.

When the user selects a product category from the list, the user should be redirected to another page with on the left side the same widget with details of the product group and on the content side, a list of products that belong to the selected product category.
The url should then be http://www.6xinternational/pg/my-productgroup/my-productcategory.

When the user selects the product, they should be directed to a page that displays the details of the product but on the left side again the widget with the product group details.

The content part is not such a problem to implement with the examples I found. It's more the widget that displays the product group details on the left side that I am struggling with.
I guess I need to analyse somehow the url and get the product group out of that and display the details of that product group. Not sure on how to implement this though.

Thanks in advance!
Nov 22, 2013 at 9:31 AM
2 'off topic' remarks

1) maybe fix the url of your link (it points to
2) your menu is hardly useable @ Chrome
Nov 22, 2013 at 9:49 AM
Thanks for your feedback. Firefox also has problems with the menu. That's one of the reasons we are migrating the site to Orchard.
Nov 22, 2013 at 12:39 PM
So if I understand correctly basically you'd like your widget (what displays a hierarchy of categories) to adapt to the level in the hierarchy where the user is.

I think you could use Taxonomies instead of implementing your own custom ProductGroups, then you also get some basic navigation for the hierarchy represented by your taxonomies. How Taxonomies are handled is highly customizable too, so you could enhance what's already there instead of writing everything from scratch.

If you definitely want to go with your implementation for some reason then yes, you could either check the URL or you could infer information from the currently opened product or group. You can access the current URL (and much more) through IHttpContextAccessor. If your content items (groups and products) are displayed through the default ItemController then you can also get their IDs from the current route's route data dictionary (it's under the "id" key), thus you can also fetch the items and get back to their location in the hierarchy.
Nov 22, 2013 at 1:50 PM
Do you have a highlevel overview of steps to take to accomplish this with Taxonomies?
Nov 22, 2013 at 3:04 PM
You can basically do the following.
  1. Set up a new Taxonomy for all your product groups.
  2. Set up the hierarchy of groups in it by adding Taxonomy terms.
  3. Create a new menu with Taxonomy menu items.
  4. Create a menu widget with this menu.
This will give you a basic menu with your category hierarchy that you can then build upon.