C# 클래스 Sitecore.SharedSource.Commons.Utilities.SitecoreLinkUtil

Utilities for retrieving URLs to various things in Sitecore.
파일 보기 프로젝트 열기: Velir/Sitecore-Commons

공개 메소드들

메소드 설명
GetDeviceUrlForItem ( System.Item item, DeviceItem device ) : string

Return the Url for for a specified item to show a certain device. If successful this method will return the url to the item with the proper device url parameter appended. If not successful return an empty string.

GetDeviceUrlForItem ( System.Item item, DeviceItem device, UrlOptions urlOptions ) : string

Returns the url for a specified item and a specific device. UrlOptions will be used if they are provided, but are not required. If successful, a url for the item will be returned. If not successfully, an empty string will be returned.

GetFullMediaUrl ( Database db, MediaItem image ) : string

Returns the URL for a media library item. This will return an empty string if there are problems with the image, or if the media id points to a non existant image. This method should be used instead of the src for an image field. That src field is not guaranteed to be updated if the media item moves, by using this method, even if the item moves, the URL will be correct.

GetMediaSrc ( Database db, MediaItem mediaItem ) : string

Gets the media source for a media item in the specified database. The path will come out in the following form ~/media/{MEDIA PATH}.{MEDIA EXTENSION}

메소드 상세

GetDeviceUrlForItem() 공개 정적인 메소드

Return the Url for for a specified item to show a certain device. If successful this method will return the url to the item with the proper device url parameter appended. If not successful return an empty string.
public static GetDeviceUrlForItem ( System.Item item, DeviceItem device ) : string
item System.Item The item.
device DeviceItem The device.
리턴 string

GetDeviceUrlForItem() 공개 정적인 메소드

Returns the url for a specified item and a specific device. UrlOptions will be used if they are provided, but are not required. If successful, a url for the item will be returned. If not successfully, an empty string will be returned.
public static GetDeviceUrlForItem ( System.Item item, DeviceItem device, UrlOptions urlOptions ) : string
item System.Item The item to get the url for.
device DeviceItem [optional] The device for the url.
urlOptions UrlOptions [optional] The url parameters for the url.
리턴 string

GetFullMediaUrl() 공개 정적인 메소드

Returns the URL for a media library item. This will return an empty string if there are problems with the image, or if the media id points to a non existant image. This method should be used instead of the src for an image field. That src field is not guaranteed to be updated if the media item moves, by using this method, even if the item moves, the URL will be correct.
public static GetFullMediaUrl ( Database db, MediaItem image ) : string
db Database The Sitecore db.
image MediaItem The image custom item.
리턴 string

GetMediaSrc() 공개 정적인 메소드

Gets the media source for a media item in the specified database. The path will come out in the following form ~/media/{MEDIA PATH}.{MEDIA EXTENSION}
public static GetMediaSrc ( Database db, MediaItem mediaItem ) : string
db Database The sitecore database where the media item lives.
mediaItem MediaItem The media item to look for.
리턴 string