November Happy Hour will be moved to Thursday December 5th.

Class SegmentHelper

Helper class for routing segments.

Inheritance
System.Object
SegmentHelper
Namespace: EPiServer.Web.Routing.Segments
Assembly: EPiServer.Cms.AspNetCore.Routing.dll
Version: 12.0.3
Syntax
public static class SegmentHelper : Object

Methods

GetModifiedVirtualPathInEditOrPreviewMode(ContentReference, String, ContextMode)

Gets a modified virtual path in edit/preview mode, if the contextMode is in edit or preview mode.

Declaration
public static string GetModifiedVirtualPathInEditOrPreviewMode(ContentReference contentLink, string virtualPath, ContextMode contextMode)
Parameters
Type Name Description
ContentReference contentLink

The content link.

System.String virtualPath

The original virtual path.

ContextMode contextMode

The context mode.

Returns
Type Description
System.String

A modified virtual path if the contextMode is in edit/preview mode, otherwise the virtualPath

TryGetIncomingNodeInEditOrPreviewMode(ContextMode, SegmentPair, out ContentReference)

Tries to get the incoming node in edit/preview mode.

Declaration
public static bool TryGetIncomingNodeInEditOrPreviewMode(ContextMode contextMode, SegmentPair segmentPair, out ContentReference versionSpecificContentReference)
Parameters
Type Name Description
ContextMode contextMode

The context mode

SegmentPair segmentPair

The segment pair to use.

ContentReference versionSpecificContentReference

The returned content reference.

Returns
Type Description
System.Boolean

True if the context is in edit/preview mode, and a version specific content reference was found. Otherwise false.