Class PageViewModelExtensions
- Namespace
- Dynamicweb.Frontend
- Assembly
- Dynamicweb.dll
Provides extension methods for the PageViewModel.
- Inheritance
-
Page
View Model Extensions
- Inherited Members
Methods
GetButtonStyle(PageViewModel?)
Gets the link to the css file with the area's button styles.
Parameters
pageViewModelPageView Model
Returns
- string
E.g. /Files/System/Styles/Buttons/SwiftStyle.css
GetColorSchemeStyle(PageViewModel?)
Gets the link to the css file with the area's color scheme group.
Parameters
pageViewModelPageView Model
Returns
- string
E.g. /Files/System/Styles/ColorSchemes/SwiftStyle.css
GetHreflangLinks(PageViewModel, HrefLanguageMode)
Generates hreflang <link rel="alternate"> tags for the specified page view model and URL context.
public static string? GetHreflangLinks(this PageViewModel model, HrefLanguageMode mode = HrefLanguageMode.Mixed)
Parameters
modelPageView Model The Page
View instance containing the page and its available language versions.Model modeHrefLanguage Mode Determines how hreflang attributes are formatted. Full
Culture uses the full language–region code (e.g. "de-de"), LanguageOnly uses only the language code (e.g. "de"), and Mixed automatically decides based on language duplication across regions.
Returns
- string
A string containing a set of hreflang link elements for all published language versions of the page, including an
x-defaultentry for the master area. Returns an empty string if no languages are defined.
Remarks
This method uses Uri
The mode parameter controls the granularity of the hreflang attributes:
- RegionOnly: Always output full locale codes, e.g.
en-us. - LanguageOnly: Always output short language codes, e.g.
en. - Mixed: Use the short code when the language is unique; use the full code when multiple regions share the same language.
GetTypographyStyle(PageViewModel?)
Gets the link to the css file with the area's typography.
Parameters
pageViewModelPageView Model
Returns
- string
E.g. /Files/System/Styles/Typography/SwiftStyle.css
TryGetButtonStyle(PageViewModel?, out string?)
Returns true if a button style is specified on the area and the link to the css is assigned to the passed out parameter.
Parameters
pageViewModelPageView Model valuestring
Returns
- bool
trueif the button style is found and the value will have a value of e.g. /Files/System/Styles/Typography/SwiftStyle.css, otherwisefalseand value will benull
TryGetColorSchemeStyle(PageViewModel?, out string?)
Returns true if a color scheme group is specified on the area and the link to the css is assigned to the passed out parameter.
Parameters
pageViewModelPageView Model valuestring
Returns
- bool
trueif the color scheme is found and the value will have a value of e.g. /Files/System/Styles/ColorSchemes/SwiftStyle.css, otherwisefalseand value will benull
TryGetTypographyStyle(PageViewModel?, out string?)
Returns true if a typography is specified on the area and the link to the css is assigned to the passed out parameter.
Parameters
pageViewModelPageView Model valuestring
Returns
- bool
trueif the typography is found and the value will have a value of e.g. /Files/System/Styles/Typography/SwiftStyle.css, otherwisefalseand value will benull