content icon indicating copy to clipboard operation
content copied to clipboard

Add `link` option to custom input mapping

Open BenjaminOddou opened this issue 4 months ago • 2 comments

Is your feature request related to a problem? Please describe.

Currently, the custom input mapping for collection schemas via the .editor() method is very useful. It provides specialized UI for media and icon inputs, which greatly improves the content editing experience.

However, when a schema requires a URL (either an internal path or an external link), the only option is a standard z.string(), which renders a plain text input. This forces content editors to manually type or paste URLs. This experience is inconsistent with the much more user-friendly link pop-up that appears when creating a link directly in the Notion-like Markdown editor. That pop-up allows searching for internal pages, but also let the user input external links too.

Image

The pop-up

Image

Describe the solution you'd like

I propose adding a third option to the custom input mapping: input: 'link'.

When a Zod schema field is configured with this option, Nuxt Studio's form editor would render an input field that includes a button or icon to trigger the existing link editing pop-up.

Describe alternatives you've considered

The only alternative is to continue using a standard z.string(), which requires users to manually manage URLs. This is less intuitive and more prone to typos, especially for complex internal paths.

Additional context

Here is an example of how this feature might be used in a content.config.ts file:

redirectTo: z.string().editor({ input: 'link' }).optional()

BenjaminOddou avatar Aug 29 '25 16:08 BenjaminOddou

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Nov 04 '25 11:11 github-actions[bot]

👀

BenjaminOddou avatar Nov 04 '25 11:11 BenjaminOddou