Is there a "scope to folder" or at least "default to folder" option for the content hub?

When I worked with Sitecore and was creating components that allowed you to select content from the content tree, you could specify a specific folder so that authors would be defaulted to only viewing/creating/consuming content from that folder. For example, if I have an Image widget that lets you pick an image from the content hub, I want to specify that the "select content item" picker defaults to ContentHubRoot/images/inline/my-inline-image.jpg.

I'd love the ability to "restrict" content for a widget to a specific folder, but I would settle for defaulting it. It's a quality of life improvement for authors to be sent right to the correct folder for that content item.

I have a feeling I'll have to create my own selector for this because it doesn't exist today as far as I could see.

I ran it through some AI to see if it found stuff in the docs, and it basically said that the challenge is on the UI side, as it wasn't sure if it exposed a property to preselect a folder. It said:

"This is where you hit the main uncertainty. The built-in Kentico.Administration.ContentItemSelector React component is not exposed through the public @kentico/xperience-admin-components npm package (I checked the type declarations). So you have two options:

Option A: Try passing ResolvedFolderGuid to the built-in component

Set ClientComponentName = "Kentico.Administration.ContentItemSelector" and include your ResolvedFolderGuid in the client properties. If the internal Kentico React component accepts an undocumented folder prop, this works with zero custom TSX. The downside is it's not in the public API — you'd need to verify by:

  1. Using browser DevTools on the existing selector to inspect what props the React component receives
  2. Or searching Kentico's community/GitHub for whether a folder initial-state prop exists

Option B: Custom React component (more work, fully controlled)

This is the reliable path but requires building a selector UI. In Client/src/form-components/FolderScopedItemSelector.tsx:"


Has anyone done this before? If this works out, I'd also like to add some functionality to create folders on the fly when creating an item, as I feel that's also a gap, but I'll focus on that later. First thing, I'd like to default the content hub folder for my authors.


Environment

  • Xperience by Kentico version: [31]

  • .NET version: [10]

  • Execution environment: [Azure]

Tags:
Content management Components Custom modules Developer tools

Answers

To response this discussion, you have to login first.