Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentBaseExtensions

    Provides extension methods to IContentBase to get URL segments.

    Inheritance
    System.Object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Core.dll
    Syntax
    public static class ContentBaseExtensions

    Methods

    View Source

    GetUrlSegment(IContentBase, IShortStringHelper, IEnumerable<IUrlSegmentProvider>, String, Boolean)

    Gets a single URL segment for a specified content and culture.

    Declaration
    public static string GetUrlSegment(this IContentBase content, IShortStringHelper shortStringHelper, IEnumerable<IUrlSegmentProvider> urlSegmentProviders, string culture = null, bool published = true)
    Parameters
    Type Name Description
    IContentBase content

    The content.

    IShortStringHelper shortStringHelper
    IEnumerable<IUrlSegmentProvider> urlSegmentProviders
    System.String culture

    The culture.

    System.Boolean published

    Whether to get the published or draft.

    Returns
    Type Description
    System.String

    The URL segment.

    Remarks

    If more than one URL segment provider is available, the first one that returns a non-null value will be returned.

    View Source

    GetUrlSegments(IContentBase, IShortStringHelper, IEnumerable<IUrlSegmentProvider>, String, Boolean)

    Gets all URL segments for a specified content and culture.

    Declaration
    public static IEnumerable<string> GetUrlSegments(this IContentBase content, IShortStringHelper shortStringHelper, IEnumerable<IUrlSegmentProvider> urlSegmentProviders, string culture = null, bool published = true)
    Parameters
    Type Name Description
    IContentBase content

    The content.

    IShortStringHelper shortStringHelper
    IEnumerable<IUrlSegmentProvider> urlSegmentProviders
    System.String culture

    The culture.

    System.Boolean published

    Whether to get the published or draft.

    Returns
    Type Description
    IEnumerable<System.String>

    The collection of URL segments.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • GetUrlSegment(IContentBase, IShortStringHelper, IEnumerable<IUrlSegmentProvider>, String, Boolean)
      • GetUrlSegments(IContentBase, IShortStringHelper, IEnumerable<IUrlSegmentProvider>, String, Boolean)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX