The various category views may list categories for a customer to explore. When they do, the CategoryMenuItemViewModel is used to render each individual category in the category menu. This article will help you understand what's available to you in the view model.
The following pre-requisites will be necessary to accomplish the goals of this article:
- General understanding of template engines
- Familiarity with template languages
- Familiarity with ASP.NET MVC Razor
There are no tasks needed to get started with understanding this object.
The CategoryMenuItemViewModel object will contain all of the details of a single menu item used in the category menu that is rendered to customers.
The following table gives you details on the various members of the CategoryMenuItemViewModel object. The descriptions are based upon default functionality and the default Viewset included with Hotcakes.
Unique identifier of the category.
|Description||String||Description of the category which is shown when a specific category is chosen.|
|IsCurrent||Bool||Used to indicate if the customer is currently viewing this category or another one.|
|Items||List<CategoryMenuItemViewModel>||If there are list of sub/child categories then this list represent all child category information.|
|ProductsCount||Int||Number of products under this category even after applying different filters. Shown when the module settings allow it to be displayed.|
|Title||String||User friendly name of the category set in the administration area.|
|Url||String||URL related to this category based on the current culture selected by the customer.|