@umbraco-cms/backoffice
    Preparing search index...

    An identifier representing a Variant. This is at current state a culture and a segment. The identifier is not specific for ContentType Variants, but is used for many type of identification of a culture and a segment. One case is any property of a ContentType can be resolved into a VariantId depending on their structural settings such as Vary by Culture and Vary by Segmentation.

    Instances are immutable. Methods that derive a variant return a new instance rather than modifying this one.

    Index
    • Parameters

      • Optionalculture: string | null

        The culture. null, undefined and 'invariant' all mean culture invariant.

      • Optionalsegment: string | null

        The segment. null and undefined both mean segment invariant.

      Returns UmbVariantId

    culture: string | null = null

    The culture of this variant, or null when it is culture invariant.

    segment: string | null = null

    The segment of this variant, or null when it is segment invariant (unsegmented).

    INVARIANT: Readonly<UmbVariantId> = ...

    A shared instance representing the invariant variant, meaning it has no culture and no segment.

    • Describes how a given Variant Id differs from this one, as a display string.

      Parameters

      • variantId: UmbVariantId

        The Variant Id to compare with.

      • OptionalinvariantMessage: string = 'Invariant'

        The text used when the cultures differ.

      • OptionalunsegmentedMessage: string = 'Unsegmented'

        The text used when the segments differ.

      Returns string

      The description, or an empty string when there are no differences.

    • Creates a Variant Id reduced to the dimensions that are allowed to vary. A dimension that does not vary becomes invariant.

      Parameters

      • OptionalvaryByCulture: boolean

        Whether to keep the culture.

      • OptionalvaryBySegment: boolean

        Whether to keep the segment.

      Returns UmbVariantId

      A new Variant Id.