Class VariationContext
Represents the variation context.
Inheritance
object
Namespace: Umbraco.Cms.Core.Models.PublishedContent
Assembly: Umbraco.Core.dll
Syntax
public class VariationContext
Constructors
View SourceVariationContext(string?, string?)
Initializes a new instance of the VariationContext class.
Declaration
public VariationContext(string? culture = null, string? segment = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | |
| string | segment |
Properties
View SourceCulture
Gets the culture.
Declaration
public string Culture { get; }
Property Value
| Type | Description |
|---|---|
| string |
Segment
Gets the segment.
Declaration
public string Segment { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceGetSegment(int)
Gets the segment for the content item.
Declaration
public virtual string GetSegment(int contentId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contentId | The content Id. |
Returns
| Type | Description |
|---|---|
| string |
GetSegment(int, string)
Gets the segment for the content item and property alias.
Declaration
public virtual string GetSegment(int contentId, string propertyAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contentId | The content Id. |
| string | propertyAlias | The property alias. |
Returns
| Type | Description |
|---|---|
| string |