C# Class Geta.EPi.Extensions.LinkItemExtensions

LinkItem Extensions.
显示文件 Open project: Geta/EPi.Extensions

Public Methods

Method Description
GetFriendlyUrl ( this linkItem, bool includeHost = false ) : string

Returns friendly URL if item is EPiServer content, otherwise returns the original Href property value.

ToContent ( this source ) : IContent

Returns IContent for provided LinkItem if it is EPiServer content otherwise returns null.

ToContentReference ( this source ) : EPiServer.Core.ContentReference

Returns ContentReference for provided LinkItem if it is EPiServer content otherwise returns EmptyReference.

Method Details

GetFriendlyUrl() public static method

Returns friendly URL if item is EPiServer content, otherwise returns the original Href property value.
public static GetFriendlyUrl ( this linkItem, bool includeHost = false ) : string
linkItem this Source LinkItem for which to return external URL.
includeHost bool Mark if include host name in the url.
return string

ToContent() public static method

Returns IContent for provided LinkItem if it is EPiServer content otherwise returns null.
public static ToContent ( this source ) : IContent
source this Source LinkItem for which to return content.
return IContent

ToContentReference() public static method

Returns ContentReference for provided LinkItem if it is EPiServer content otherwise returns EmptyReference.
public static ToContentReference ( this source ) : EPiServer.Core.ContentReference
source this Source LinkItem for which to return content reference.
return EPiServer.Core.ContentReference