System Library Common Episerver
Search Results for

    DocFx,SystemLibrary.Common.Episerver.Properties.MessageConfig,SystemLibrary.Common.Episerver.Properties.MessageEditorDescriptor,SystemLibrary.Common.Episerver.Properties.MessageProperty,SystemLibrary.Common.Episerver.Properties.MessageController,SystemLibrary.Common.Episerver.Attributes.BoxSelectionController,SystemLibrary.Common.Episerver.Attributes.BoxSelectionFactory,SystemLibrary.Common.Episerver.Attributes.JsonEditController,SystemLibrary.Common.Episerver.Attributes.JsonEditFactory,SystemLibrary.Common.Episerver.Descriptors.HideCategoryListDescriptor,SystemLibrary.Common.Episerver.Properties.ParentLinkReferenceController,SystemLibrary.Common.Episerver.Properties.ParentLinkReferenceEditorDescriptor,SystemLibrary.Common.Episerver.Properties.ParentLinkReferenceProperty,SystemLibrary.Common.Episerver.Attributes.MultiDropdownSelectionController,SystemLibrary.Common.Episerver.Attributes.MultiDropdownSelectionFactory,SystemLibrary.Common.Episerver.Initialize.RemoveSuggestedContentTypes,SystemLibrary.Common.Episerver.Extensions.CommonEpiserverApplicationServicesOptions,SystemLibrary.Common.Episerver.Extensions.CommonEpiserverApplicationBuilderOptions,SystemLibrary.Common.Episerver.EditController,SystemLibrary.Common.Episerver.Abstract.BaseController,SystemLibrary.Common.Episerver.Abstract.BaseMultiSelectionFactory,SystemLibrary.Common.Episerver.ConnectionStringsConfig,SystemLibrary.Common.Episerver.PropertiesConfig,SystemLibrary.Common.Episerver.EditConfig,SystemLibrary.Common.Episerver.Properties.MessageConfig,SystemLibrary.Common.Episerver.FontAwesome,SystemLibrary.Common.Episerver.AppSettings.Configuration,SystemLibrary.Common.Episerver.Attributes.ParentLinkReferenceFactory,SystemLibrary.Common.Episerver.Abstract.InternalBaseController,WebApplicationInitializer
    Show / Hide Table of Contents
    NamespaceSystemLibrary.Common.Episerver.Extensions SystemLibrary.Common.Episerver.dll

    Common content reference extensions

    ContentReferenceExtensions

    public static class ContentReferenceExtensions

    Inheritance
    System.Object
    ContentReferenceExtensions
    Examples
    Arguments
    X

    Methods

    Returns true if the content reference is not null and has an ID larger than 0, else false

    View Source

    public static bool Is(this ContentReference contentReference)

    X
    Methods arguments
    Type Name Description
    EPiServer.Core.ContentReference contentReference
    X
    Type Description
    System.Boolean

    Returns true if the contentReference is null, or have an ID less than 1, else false

    View Source

    public static bool IsNot(this ContentReference contentReference)

    X
    Methods arguments
    Type Name Description
    EPiServer.Core.ContentReference contentReference
    X
    Type Description
    System.Boolean

    Convert content reference to content data of type T

    T can be a block, page or media data

    Returns content or null if not found
    Remarks
    X

    filterByDisplayable: content cannot be deleted, it must be published, current user must have read access and code of the content type must exist

    View Source

    public static T To<T>(this ContentReference contentReference, bool filterByDisplayable = true) where T : IContentData

    X
    var articlePage = contentReference.To<ArticlePage>();
    
    var textBlock = contentReference.To<TextBlock>();
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    EPiServer.Core.ContentReference contentReference
    System.Boolean filterByDisplayable
    X
    Type Description
    T

    Returns a friendly url behind the content reference, or null if content reference is null or has an invalid ID

    View Source

    public static string ToFriendlyUrl(this ContentReference contentReference, bool? convertToAbsolute = null)

    X
    Methods arguments
    Type Name Description
    EPiServer.Core.ContentReference contentReference
    System.Nullable<System.Boolean> convertToAbsolute
    X
    Type Description
    System.String

    }

    • View Source
    In This Article
    Package: nuget
    Source: github
    Website: System Library Common Episerver