Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentSettingsExtensions

    Extension methods for ContentSettings.

    Inheritance
    object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Core.dll
    Syntax
    public static class ContentSettingsExtensions

    Methods

    View Source

    GetConfig(ContentSettings, string)

    Gets the auto-fill configuration for a specified property alias.

    Declaration
    public static ImagingAutoFillUploadField? GetConfig(this ContentSettings contentSettings, string propertyTypeAlias)
    Parameters
    Type Name Description
    ContentSettings contentSettings

    The content settings.

    string propertyTypeAlias

    The property type alias.

    Returns
    Type Description
    ImagingAutoFillUploadField

    The auto-fill configuration for the specified property alias or null if not configured.

    View Source

    IsAllowedImageFileType(ContentSettings, string)

    Determines whether the given file extension is allowed for an uploaded image, based on the configured image file types (ImageFileTypes) and the disallowed upload extensions (DisallowedUploadedFileExtensions).

    Declaration
    public static bool IsAllowedImageFileType(this ContentSettings contentSettings, string extension)
    Parameters
    Type Name Description
    ContentSettings contentSettings

    The content settings.

    string extension

    The file extension, without a leading period.

    Returns
    Type Description
    bool

    true if the extension is a configured image file type and is not explicitly disallowed; otherwise, false.

    View Source

    IsFileAllowedForUpload(ContentSettings, string)

    Determines if file extension is allowed for upload based on (optional) allow list and deny list held in settings. Disallowed file extensions are only considered if there are no allowed file extensions.

    Declaration
    public static bool IsFileAllowedForUpload(this ContentSettings contentSettings, string extension)
    Parameters
    Type Name Description
    ContentSettings contentSettings

    The content settings.

    string extension

    The file extension.

    Returns
    Type Description
    bool

    true if the file extension is allowed for upload; otherwise, false.

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