Skip to content

Option to render field hints as tooltips #18826

@Klabos

Description

@Klabos

Hi,

we recently reviewed the UX of the CMS administration with our design team. We identified that the current method of displaying field hints (as static text below the input field) can sometimes clutter the UI or be overlooked. We believe that offering an alternative visualization would improve the user experience.

I propose adding an option to render hints as a question mark icon with a tooltip, rather than the standard text block.

I have already created a quick proof of concept internally. Since OrchardCore already utilizes Bootstrap and FontAwesome, this enhancement requires no new external dependencies or major architectural changes. It only involves updating the specific Field Views.

Image

Proof of Concept
Here is an example of the implementation in TextField.Edit.cshtml (the original hint rendering is commented out):

<div>
    <label asp-for="Text" class="@Orchard.GetLabelClasses(inputRequired: settings.Required)">@Model.PartFieldDefinition.DisplayName()</label>
    @if (!string.IsNullOrEmpty(settings.Hint))
    {
        @* <span class="hint dashed">@settings.Hint</span> *@
        <button class="btn btn-link btn-hint"
                type="button"
                data-bs-toggle="tooltip"
                data-bs-delay='{"show":200,"hide":50}'
                data-bs-placement="top"
                data-bs-title='@settings.Hint'>
            <i class="fa-regular fa-circle-question"></i>
        </button>
    }
</div>

Implementation Details
To make this flexible, I suggest adding a configuration setting (e.g., a checkbox in the Field definition settings) that allows the administrator to choose between the "Original Hint" (text below) and the "Tooltip Hint" (icon).

Image

Contribution
I am willing to implement this feature and submit a PR. I believe this offers significant UX value with minimal impact on the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions