Class NavigationTemplateHelper
- Namespace
- Dynamicweb.Frontend.Navigation
- Assembly
- Dynamicweb.dll
Helper for working with navigations in templates.
public class NavigationTemplateHelper
- Inheritance
-
NavigationTemplateHelper
- Inherited Members
Constructors
NavigationTemplateHelper(NavigationContext)
public NavigationTemplateHelper(NavigationContext context)
Parameters
contextNavigationContext
Methods
GetNavigationViewModel(NavigationSettings)
Creates a navigation view model based on the provided navigation settings.
public NavigationTreeViewModel? GetNavigationViewModel(NavigationSettings settings)
Parameters
settingsNavigationSettingsNavigation settings used for generating the navigation and view model.
Returns
- NavigationTreeViewModel
An instance of NavigationTreeViewModel
RenderNavigation(string)
Renders a navigation to a given template based on current context and default settings.
public string RenderNavigation(string templatePath)
Parameters
templatePathstringPath to the template used for rendering the navigation, e.g. "menu.cshtml"
Returns
RenderNavigation(string, NavigationSettings)
Renders a navigation to a given template based on current context and the provided settings.
public string RenderNavigation(string templatePath, NavigationSettings settings)
Parameters
templatePathstringPath to the template used for rendering the navigation, e.g. "menu.cshtml"
settingsNavigationSettingsSettings used for generating the navigation.