Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentVariationExtensions

    Provides extension methods for content variations.

    Inheritance
    System.Object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Core.dll
    Syntax
    public static class ContentVariationExtensions

    Methods

    View Source

    SetFlag(ContentVariation, ContentVariation, Boolean)

    Returns the variations with the variation set or removed depending on the specified value.

    Declaration
    public static ContentVariation SetFlag(this ContentVariation variations, ContentVariation variation, bool value = true)
    Parameters
    Type Name Description
    ContentVariation variations

    The existing variations.

    ContentVariation variation

    The variation to set or remove.

    System.Boolean value

    If set to true sets the variation; otherwise, removes the variation.

    Returns
    Type Description
    ContentVariation

    The variations with the variation set or removed.

    Remarks

    This method does not support setting the variation to nothing.

    View Source

    SetVariesBy(IContentTypeBase, ContentVariation, Boolean)

    Sets or removes the content type variation depending on the specified value.

    Declaration
    public static void SetVariesBy(this IContentTypeBase contentType, ContentVariation variation, bool value = true)
    Parameters
    Type Name Description
    IContentTypeBase contentType

    The content type.

    ContentVariation variation

    The variation to set or remove.

    System.Boolean value

    If set to true sets the variation; otherwise, removes the variation.

    Remarks

    This method does not support setting the variation to nothing.

    View Source

    SetVariesBy(IPropertyType, ContentVariation, Boolean)

    Sets or removes the property type variation depending on the specified value.

    Declaration
    public static void SetVariesBy(this IPropertyType propertyType, ContentVariation variation, bool value = true)
    Parameters
    Type Name Description
    IPropertyType propertyType

    The property type.

    ContentVariation variation

    The variation to set or remove.

    System.Boolean value

    If set to true sets the variation; otherwise, removes the variation.

    Remarks

    This method does not support setting the variation to nothing.

    View Source

    ValidateVariation(ContentVariation, String, String, Boolean, Boolean, Boolean)

    Validates that a combination of culture and segment is valid for the variation.

    Declaration
    public static bool ValidateVariation(this ContentVariation variation, string culture, string segment, bool exact, bool wildcards, bool throwIfInvalid)
    Parameters
    Type Name Description
    ContentVariation variation

    The variation.

    System.String culture

    The culture.

    System.String segment

    The segment.

    System.Boolean exact

    A value indicating whether to perform exact validation.

    System.Boolean wildcards

    A value indicating whether to support wildcards.

    System.Boolean throwIfInvalid

    A value indicating whether to throw a when the combination is invalid.

    Returns
    Type Description
    System.Boolean

    true if the combination is valid; otherwise false.

    Remarks

    When validation is exact, the combination must match the variation exactly. For instance, if the variation is Culture, then a culture is required. When validation is not strict, the combination must be equivalent, or more restrictive: if the variation is Culture, an invariant combination is ok.

    Basically, exact is for one content type, or one property type, and !exact is for "all property types" of one content type.

    Both culture and segment can be "*" to indicate "all of them".

    View Source

    VariesByCulture(ContentVariation)

    Determines whether a variation varies by culture.

    Declaration
    public static bool VariesByCulture(this ContentVariation variation)
    Parameters
    Type Name Description
    ContentVariation variation

    The variation.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the variation varies by culture.

    View Source

    VariesByCulture(IContentTypeBase)

    Determines whether the content type varies by culture.

    Declaration
    public static bool VariesByCulture(this IContentTypeBase contentType)
    Parameters
    Type Name Description
    IContentTypeBase contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by culture.

    View Source

    VariesByCulture(IPropertyType)

    Determines whether the property type varies by culture.

    Declaration
    public static bool VariesByCulture(this IPropertyType propertyType)
    Parameters
    Type Name Description
    IPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type varies by culture.

    View Source

    VariesByCulture(ISimpleContentType)

    Determines whether the content type varies by culture.

    Declaration
    public static bool VariesByCulture(this ISimpleContentType contentType)
    Parameters
    Type Name Description
    ISimpleContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by culture.

    View Source

    VariesByCulture(IPublishedContentType)

    Determines whether the content type varies by culture.

    Declaration
    public static bool VariesByCulture(this IPublishedContentType contentType)
    Parameters
    Type Name Description
    IPublishedContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by culture.

    View Source

    VariesByCulture(IPublishedPropertyType)

    Determines whether the property type varies by culture.

    Declaration
    public static bool VariesByCulture(this IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type varies by culture.

    View Source

    VariesByCultureAndSegment(ContentVariation)

    Determines whether a variation varies by culture and segment.

    Declaration
    public static bool VariesByCultureAndSegment(this ContentVariation variation)
    Parameters
    Type Name Description
    ContentVariation variation

    The variation.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the variation varies by culture and segment.

    View Source

    VariesByCultureAndSegment(IContentTypeBase)

    Determines whether the content type varies by culture and segment.

    Declaration
    public static bool VariesByCultureAndSegment(this IContentTypeBase contentType)
    Parameters
    Type Name Description
    IContentTypeBase contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by culture and segment.

    View Source

    VariesByCultureAndSegment(IPropertyType)

    Determines whether the property type varies by culture and segment.

    Declaration
    public static bool VariesByCultureAndSegment(this IPropertyType propertyType)
    Parameters
    Type Name Description
    IPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type varies by culture and segment.

    View Source

    VariesByCultureAndSegment(ISimpleContentType)

    Determines whether the content type varies by culture and segment.

    Declaration
    public static bool VariesByCultureAndSegment(this ISimpleContentType contentType)
    Parameters
    Type Name Description
    ISimpleContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by culture and segment.

    View Source

    VariesByCultureAndSegment(IPublishedContentType)

    Determines whether the content type varies by culture and segment.

    Declaration
    public static bool VariesByCultureAndSegment(this IPublishedContentType contentType)
    Parameters
    Type Name Description
    IPublishedContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by culture and segment.

    View Source

    VariesByCultureAndSegment(IPublishedPropertyType)

    Determines whether the property type varies by culture and segment.

    Declaration
    public static bool VariesByCultureAndSegment(this IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type varies by culture and segment.

    View Source

    VariesByNothing(ContentVariation)

    Determines whether a variation is invariant.

    Declaration
    public static bool VariesByNothing(this ContentVariation variation)
    Parameters
    Type Name Description
    ContentVariation variation

    The variation.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the variation is invariant.

    View Source

    VariesByNothing(IContentTypeBase)

    Determines whether the content type is invariant.

    Declaration
    public static bool VariesByNothing(this IContentTypeBase contentType)
    Parameters
    Type Name Description
    IContentTypeBase contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type is invariant.

    View Source

    VariesByNothing(IPropertyType)

    Determines whether the property type is invariant.

    Declaration
    public static bool VariesByNothing(this IPropertyType propertyType)
    Parameters
    Type Name Description
    IPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type is invariant.

    View Source

    VariesByNothing(ISimpleContentType)

    Determines whether the content type is invariant.

    Declaration
    public static bool VariesByNothing(this ISimpleContentType contentType)
    Parameters
    Type Name Description
    ISimpleContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type is invariant.

    View Source

    VariesByNothing(IPublishedContentType)

    Determines whether the content type is invariant.

    Declaration
    public static bool VariesByNothing(this IPublishedContentType contentType)
    Parameters
    Type Name Description
    IPublishedContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type is invariant.

    View Source

    VariesByNothing(IPublishedPropertyType)

    Determines whether the property type is invariant.

    Declaration
    public static bool VariesByNothing(this IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type is invariant.

    View Source

    VariesBySegment(ContentVariation)

    Determines whether a variation varies by segment.

    Declaration
    public static bool VariesBySegment(this ContentVariation variation)
    Parameters
    Type Name Description
    ContentVariation variation

    The variation.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the variation varies by segment.

    View Source

    VariesBySegment(IContentTypeBase)

    Determines whether the content type varies by segment.

    Declaration
    public static bool VariesBySegment(this IContentTypeBase contentType)
    Parameters
    Type Name Description
    IContentTypeBase contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by segment.

    View Source

    VariesBySegment(IPropertyType)

    Determines whether the property type varies by segment.

    Declaration
    public static bool VariesBySegment(this IPropertyType propertyType)
    Parameters
    Type Name Description
    IPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type varies by segment.

    View Source

    VariesBySegment(ISimpleContentType)

    Determines whether the content type varies by segment.

    Declaration
    public static bool VariesBySegment(this ISimpleContentType contentType)
    Parameters
    Type Name Description
    ISimpleContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by segment.

    View Source

    VariesBySegment(IPublishedContentType)

    Determines whether the content type varies by segment.

    Declaration
    public static bool VariesBySegment(this IPublishedContentType contentType)
    Parameters
    Type Name Description
    IPublishedContentType contentType

    The content type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the content type varies by segment.

    View Source

    VariesBySegment(IPublishedPropertyType)

    Determines whether the property type varies by segment.

    Declaration
    public static bool VariesBySegment(this IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the property type varies by segment.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • SetFlag(ContentVariation, ContentVariation, Boolean)
      • SetVariesBy(IContentTypeBase, ContentVariation, Boolean)
      • SetVariesBy(IPropertyType, ContentVariation, Boolean)
      • ValidateVariation(ContentVariation, String, String, Boolean, Boolean, Boolean)
      • VariesByCulture(ContentVariation)
      • VariesByCulture(IContentTypeBase)
      • VariesByCulture(IPropertyType)
      • VariesByCulture(ISimpleContentType)
      • VariesByCulture(IPublishedContentType)
      • VariesByCulture(IPublishedPropertyType)
      • VariesByCultureAndSegment(ContentVariation)
      • VariesByCultureAndSegment(IContentTypeBase)
      • VariesByCultureAndSegment(IPropertyType)
      • VariesByCultureAndSegment(ISimpleContentType)
      • VariesByCultureAndSegment(IPublishedContentType)
      • VariesByCultureAndSegment(IPublishedPropertyType)
      • VariesByNothing(ContentVariation)
      • VariesByNothing(IContentTypeBase)
      • VariesByNothing(IPropertyType)
      • VariesByNothing(ISimpleContentType)
      • VariesByNothing(IPublishedContentType)
      • VariesByNothing(IPublishedPropertyType)
      • VariesBySegment(ContentVariation)
      • VariesBySegment(IContentTypeBase)
      • VariesBySegment(IPropertyType)
      • VariesBySegment(ISimpleContentType)
      • VariesBySegment(IPublishedContentType)
      • VariesBySegment(IPublishedPropertyType)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX