Search Results for

    Show / Hide Table of Contents
    View Source

    Class ApiLink

    Represents a link in the Delivery API.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Models.DeliveryApi
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class ApiLink

    Properties

    View Source

    Culture

    Gets or sets the (optional) culture of the link.

    Declaration
    public string? Culture { get; }
    Property Value
    Type Description
    string
    View Source

    DestinationId

    Gets the unique identifier of the destination content or media.

    Declaration
    public Guid? DestinationId { get; }
    Property Value
    Type Description
    Guid?
    View Source

    DestinationType

    Gets the content or media type alias of the destination.

    Declaration
    public string? DestinationType { get; }
    Property Value
    Type Description
    string
    View Source

    LinkType

    Gets the type of the link.

    Declaration
    public LinkType LinkType { get; }
    Property Value
    Type Description
    LinkType
    View Source

    QueryString

    Gets the query string of the link.

    Declaration
    public string? QueryString { get; }
    Property Value
    Type Description
    string
    View Source

    Route

    Gets the route information for the destination content.

    Declaration
    public IApiContentRoute? Route { get; }
    Property Value
    Type Description
    IApiContentRoute
    View Source

    Target

    Gets the target attribute of the link (e.g., "_blank").

    Declaration
    public string? Target { get; }
    Property Value
    Type Description
    string
    View Source

    Title

    Gets the title of the link.

    Declaration
    public string? Title { get; }
    Property Value
    Type Description
    string
    View Source

    Url

    Gets the URL of the link.

    Declaration
    public string? Url { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    Content(string, string?, string?, Guid, string, IApiContentRoute)

    Creates a link to content.

    Declaration
    [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 18.")]
    public static ApiLink Content(string title, string? queryString, string? target, Guid destinationId, string destinationType, IApiContentRoute route)
    Parameters
    Type Name Description
    string title

    The title of the link.

    string queryString

    The query string of the link.

    string target

    The target attribute of the link (e.g., "_blank").

    Guid destinationId

    The unique identifier of the destination content.

    string destinationType

    The content type alias of the destination.

    IApiContentRoute route

    The route information for the destination content.

    Returns
    Type Description
    ApiLink

    A new ApiLink instance representing a content link.

    View Source

    Content(string, string?, string?, Guid, string, IApiContentRoute, string?)

    Creates a link to content.

    Declaration
    public static ApiLink Content(string title, string? queryString, string? target, Guid destinationId, string destinationType, IApiContentRoute route, string? culture = null)
    Parameters
    Type Name Description
    string title

    The title of the link.

    string queryString

    The query string of the link.

    string target

    The target attribute of the link (e.g., "_blank").

    Guid destinationId

    The unique identifier of the destination content.

    string destinationType

    The content type alias of the destination.

    IApiContentRoute route

    The route information for the destination content.

    string culture

    The optional culture for the link.

    Returns
    Type Description
    ApiLink

    A new ApiLink instance representing a content link.

    View Source

    External(string?, string, string?, string?)

    Creates an external link.

    Declaration
    public static ApiLink External(string? title, string url, string? queryString, string? target)
    Parameters
    Type Name Description
    string title

    The title of the link.

    string url

    The external URL.

    string queryString

    The query string of the link.

    string target

    The target attribute of the link (e.g., "_blank").

    Returns
    Type Description
    ApiLink

    A new ApiLink instance representing an external link.

    View Source

    Media(string, string, string?, string?, Guid, string)

    Creates a link to media.

    Declaration
    public static ApiLink Media(string title, string url, string? queryString, string? target, Guid destinationId, string destinationType)
    Parameters
    Type Name Description
    string title

    The title of the link.

    string url

    The URL of the media.

    string queryString

    The query string of the link.

    string target

    The target attribute of the link (e.g., "_blank").

    Guid destinationId

    The unique identifier of the destination media.

    string destinationType

    The media type alias of the destination.

    Returns
    Type Description
    ApiLink

    A new ApiLink instance representing a media link.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX