Table of Contents

Class NavigationTreeViewNodeExtensions

Namespace
Dynamicweb.Ecommerce.ProductCatalog
Assembly
Dynamicweb.Ecommerce.dll

Extension methods for NavigationTreeNodeViewModel that add ecommerce product group awareness to navigation nodes.

public static class NavigationTreeViewNodeExtensions
Inheritance
NavigationTreeViewNodeExtensions
Inherited Members

Methods

GetProductGroup(NavigationTreeNodeViewModel)

Loads the ProductGroupViewModel associated with a navigation tree node.

public static ProductGroupViewModel GetProductGroup(this NavigationTreeNodeViewModel node)

Parameters

node NavigationTreeNodeViewModel

The navigation tree node whose GroupId identifies the product group.

Returns

ProductGroupViewModel

A populated ProductGroupViewModel when the node has a non-empty GroupId and the corresponding product group exists; otherwise an empty ProductGroupViewModel.

Remarks

The current request context (language, currency, country, shop, user) is resolved automatically from Common.Context and PageView.Current(). Use this in navigation Razor templates to access group-specific data such as images or SEO metadata directly from a nav node:

@{
    var group = node.GetProductGroup();
}
<a href="@node.Link">@group.Name</a>
To top