Table of Contents

Class FacetGroupViewModel

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

Represents a named group of facets used to filter product catalog search results.

public class FacetGroupViewModel : FillableViewModelBase
Inheritance
FacetGroupViewModel
Inherited Members

Remarks

In Dynamicweb, facets are organised into named groups (e.g. "Color", "Brand", "Price"). Each group contains one or more FacetViewModel instances that expose the individual filter options the customer can apply.

In Razor templates, iterate Facets to render the filter UI for each group:

@foreach (var facetGroup in Model.FacetGroups)
{
    <h4>@facetGroup.Name</h4>
    @foreach (var facet in facetGroup.Facets)
    {
        @* render facet options *@
    }
}

Properties

Description

Gets or sets an optional description of the facet group, suitable for use as a tooltip or help text.

public string Description { get; set; }

Property Value

string

FacetGroupType

Gets or sets the type identifier of the facet group, used to distinguish between different kinds of groups (e.g. field-based vs. category-based groupings).

public string FacetGroupType { get; set; }

Property Value

string

Facets

Gets or sets the facets within this group. Each FacetViewModel represents one filterable attribute and exposes its selectable Options.

public IEnumerable<FacetViewModel> Facets { get; set; }

Property Value

IEnumerable<FacetViewModel>

Name

Gets or sets the display name of the facet group (e.g. "Color", "Brand").

public string Name { get; set; }

Property Value

string

See Also

To top