Developer forum

Forum » Ecommerce - Standard features » Expandmode = Pathonly is still working?

Expandmode = Pathonly is still working?

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to render a navigation containing subgroups of the current Group.

I am using this approach:

var navigationMarkup = RenderNavigation(new
    {
        id = "leftnav",
        cssclass = "dwnavigation",
        startLevel = 1,
        endlevel = 5,
        template = "LeftNavigation.xslt",
        expandmode = "Pathonly",
        mode = "ecom"
    });

For some reason, the entire list of groups and subgroups is rendered in the output XML (using savexml=true). I have tried removing the last line (mode="ecom") but nothing changed.

I am on DW 9.9.2.

Thank you,

Adrian 


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Adrian,

 

Why not use the new Razor Navigation instead? You'll have a lot more control.

 

Nuno

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nuno,

Frankly, I was hoping for a quick fix for my issue :)

Moving over to the new Navigation would require a bit more time spent on it instead.

If this won't work, I will have to use the new Razor navigation.

Thank you,
Adrian

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Adrian,

 

To be honest, I don't know if it does. In the past we used the API to traverse through groups "navigation" because they needed to be embeded into facets/filters and the xslt navigavtion was not an option.

 

But if all you need is the current subgroups, you may be easilly get that using the API for the subgroups https://doc.dynamicweb.com/api/html/f45e896b-fbae-0e33-8a7d-c3bf615051b0.htm

 

Best Regards,

Nuno Aguiar

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nuno,

I agree.

Nevertheless, this setting is supposed to work with the old navigation approach. If it's not working anymore, it's either my fault for not setting it up correctly or it is a bug.

Thank you,

Adrian

 
Nicolai Pedersen
Reply

pathonly does not affect groups in the old navigation structure and never has.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for confirming it.

I have not used this option in a while.

Thank you,
Adrian

 
Nicolai Pedersen
Reply

But it works using the navigation viewmodels!

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

That's a very good reason to switch to navigation viewmodels.

Thank you very much for this tip.

Adrian

 

You must be logged in to post in the forum