Developer forum

Forum » Ecommerce - Standard features » How to use Ecommerce page URL provider?

How to use Ecommerce page URL provider?

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

We are trying to switch to the new Ecommerce page URL provider by replacing the old navigation provider with new setup found here: https://doc.dynamicweb.com/documentation-9/platform/platform-tools/customized-urls#sideNavTitle1-5, but the we cannot figure out how to render the navigation and our group and products are not available in the sitemap.xml.

 

Can we get rid of the "-1" urls for groups and products when switching over to the new URL provider? As this is the reason for the change.

 

Best regards, Anders


Replies

 
Nicolai Pedersen
Reply

Hi Anders

The URL provider is not related to the navigation. They are 2 different unrelated things.

By using the new URL providers on pages, you get rid of most -1 issues. Because in the old model all catalogs, groups and products in all languages is in the same index, so if you have the same group and product in more languages or more shops, you get duplicates and get the -1 issue. With the new URL model you attach a URL provider to many different pages and lock them to one language and one shop on that page - and the URLs will be part of that pages URL structure as sub-urls. That will remove most -1 issues. Only if you have 2 groups or products in the same shop in the same parent group, you will have the issue.

When you create the navigation you can use either the old XML navigation or the new Navigation viewmodels. They both use the same navigation settings found on the page properties, navigation dialog - enable ecommerce navigation. Usually, you would have the navigation and URL provider enabled on the same page. If not, your navigation settings will have to point to the page with the URL settings. See dump. This is because the catalog urls are only available on page with the URL provider attached - to avoid duplicate urls.

To use the navigation viewmodel instead of the xml navigation, do something like this:

@{ 

 var navigationSettingsMain = new Dynamicweb.Frontend.Navigation.NavigationSettings()

 {

 StartLevel = 1,

 StopLevel = 3,

 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All

 };

 NavigationTreeViewModel navigation = GetNavigation(navigationSettingsMain);


 @foreach (NavigationTreeNodeViewModel node in navigation.Nodes)

        {}

}

Sitemap.xml is running on top of the XMLnavigation no matter what. They require a group has a primary page, groups is included in sitemap and that "include products" is enabled on robots.txt on the website. See my dump2 + 3.

Also find attached a layout template that implements a custom sitemaps.xml implementation that can be manipulated.

Capture.JPG Capture2.JPG Capture3.JPG
 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Thank you so much! I can see one problem as an exact path for a parent group is not taken into account in the sub groups. This is crucial for working with the urls.

Can you please look into this?

 

Best regards, Anders

 
Nicolai Pedersen
Reply

Like my screendumps?

And in what version?

Thanks, Nicolai

Capture.JPG Capture2.JPG
 
Anders Ebdrup
Anders Ebdrup
Reply

Yes, exactly! Is that implemented in a recent version? As we are working with Dynamicweb.dll 9.8.15 and Dynamicweb.Ecommerce.dll 1.8.33?

 
Nicolai Pedersen
Reply

No apparent changes since August... Neither in this provider or in the url handler. Only changes is in resetting the URL index when things changes in groups and pages. Will the change apply on IISRESET?

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

I cannot figure out your setup, as I have tried to set it up here: http://rapido-33-full.websrv01.smartpage.dk/shop/cykler (root group has these settings: https://www.screencast.com/t/zbPdEMOXFSp), where I will expect the subgroup for "mountain bikes" to have this url: http://rapido-33-full.websrv01.smartpage.dk/shop/cykler/mine-cykler, as I have not marked "Ignore parent groups in URL" - please find this screen dump: https://www.screencast.com/t/N7MF5RHHcoez.

Am I missing something here??

 

Best regards, Anders

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Anders,

 

I noticed that the top group (https://www.screencast.com/t/zbPdEMOXFSp) does not have "Show in sitemap". have you tried enabling that?

 

I noticed your setup to be accurate but that detail stood out to me.

 

I  also noticed that you have "shop/cycler" instead of just "cykcler" - not sure if that would not cause any issues down the road, because it masks/confuses the natural way. I would have set the "Products"'s url to be "Shop" instead, but it may not be an issue.

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
Reply

It is because in the new URLProviders the URL field from a group is handled like the "Exact URL for this page" field on a page (see dump). That is where you specify the exact URL. In the old ecommerce providers the field is used like the page field "Use in URL" field of a page which will change the name used in the specific segment of the path in the URL.

So we might have to change the new providers to have the same behavior. And change the field on the group to have the same fields and options as we have on the page. Of course they are totally opposite to make it very difficult to understand... smiley3

BR Nicolai

Capture.JPG
 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Alright, then it does not seem to be usefull yet. Do you have plans to change the new provider for the group urls??

 

You must be logged in to post in the forum