Nucleus .Net Core CMS

Controls.FolderSelector Class

Namespace: Nucleus.ViewFeatures.Controls
Assembly: Nucleus.ViewFeatures.dll
Represents a folder selection control as a view component for use in Razor views.
This control provides a user interface for selecting a folder from the file system. It supports multiple file system providers, navigation through folder hierarchies, and filtering of folder contents. The control is designed to be used in forms where a folder selection is required, such as file upload destinations or folder management features.
FolderSelector (Context Context, IFileSystemManager fileSystemManager)
Initializes a new instance of the Controls.FolderSelector class.
Parameters
Name Type
Context Nucleus.Abstractions.Models.Context

The current Nucleus Context.

fileSystemManager Nucleus.Abstractions.Managers.IFileSystemManager

The file system manager instance.

Gets the current Nucleus Context.
Gets the file system manager used to interact with folders and providers.
InvokeAsync (Site site, Folder model, String propertyName, String pattern)
Renders the folder selector control.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site

The site to show folders for. If not specifed, the current site is used.

model Nucleus.Abstractions.Models.FileSystem.Folder

The Models.FileSystem.Folder object representing the currently selected folder.

propertyName String

The name of the view model property to bind the selected folder to. Defaults to "SelectedFolder".

pattern String

A regular expression pattern used to filter folder contents (files and subfolders).

Returns
An Microsoft.AspNetCore.Mvc.IViewComponentResult that renders the folder selector UI.
Remarks
The control retrieves the selected folder and its children, and prepares a view model for rendering. It supports navigation (including "up one level"), provider switching, and ensures model state consistency.