To create menus and breadcrumbs you will need to deal with this yourself, eventually using the SiteMap.Resolve event on SiteMapProvider to dynamically insert your "nonexistent" pages.
Regarding routes in C1, there is functionality that analyzes the URL on the first “real page” and gives you the extra part of the URL that you can work with. Suppose that / myshop was your store page, and the user requested / myshop / clothes, then there would still be / myshow, which will be executed, and you would put a code there that will process your categories.
The code that will retrieve the "clothes" on your myshop page will be Composite.Core.Routing.Pages.C1PageRoute.GetPathInfo()
, and to let C1 not throw a 404 error, you call Composite.Core.Routing.Pages.C1PageRoute.RegisterPathInfoUsage()
so that C1 knows that “clothing” was a valid category.
Read more about the API for it here .
If you need to handle different situations when a category is selected, and when the user simply clicks / myshop directly, you must configure the MyShop page to use a specific template, and there you will wrap the <rendering:contentplaceholder>
element in a function that has some else logic -if. If no category is selected, print the contents of <rendering:contentplaceholder>
, otherwise search by category and print other content.
source share