feat(personas): introduce new keytag custom field implementation#34625
feat(personas): introduce new keytag custom field implementation#34625
Conversation
### Summary This commit adds a new implementation for the keytag custom field, enhancing the user experience by allowing dynamic updates based on the name field input. ### Changes - **New File**: Added `keytag_custom_field_new.vtl` which includes JavaScript functions for camelizing the name input and updating the keytag field accordingly. - **Old Implementation**: The previous keytag custom field logic has been preserved in `keytag_custom_field_old.vtl` for backward compatibility. - **Integration**: Updated `keytag_custom_field.vtl` to conditionally parse the new or old implementation based on the `isNewEditModeEnabled` flag. ### Benefits This new approach improves the usability of the keytag field by allowing real-time updates and editing capabilities, enhancing the overall functionality of the personas feature.
…dering to support new edit mode ### Summary This commit refactors the file browser and tag storage field rendering templates to conditionally include new implementations based on the flag. ### Changes - **File Browser**: Removed old JavaScript and HTML structure from , now conditionally parses either or . - **Tag Storage Field**: Similar changes made in , parsing either or . ### Benefits This update streamlines the rendering logic for both components, allowing for easier maintenance and improved user experience in the new edit mode.
There was a problem hiding this comment.
Pull request overview
This pull request migrates multiple custom fields to the new Custom Field API, implementing a conditional rendering pattern based on the edit mode. The primary focus is on the persona keytag custom field (as mentioned in issue #34450), but it also includes migrations for tag storage and file browser fields, plus a refactoring of shared dropdown styles.
Changes:
- Migrated persona keytag custom field to new Custom Field API with modern JavaScript and styling
- Migrated tag storage field to new Custom Field API with dropdown implementation
- Migrated file browser field to new Custom Field API with modal integration
- Refactored shared dropdown CSS from template_custom_field_new.vtl to native-field.component.scss
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| keytag_custom_field.vtl | Main switcher that conditionally loads new/old implementation |
| keytag_custom_field_old.vtl | Preserved legacy Dojo-based keytag implementation |
| keytag_custom_field_new.vtl | New DotCustomFieldApi-based keytag implementation |
| tag_storage_field_creation.vtl | Main switcher for tag storage field |
| tag_storage_field_creation_old.vtl | Preserved legacy Dojo-based tag storage dropdown |
| tag_storage_field_creation_new.vtl | New custom dropdown with DotCustomFieldApi integration |
| file_browser_field_render.vtl | Main switcher for file browser field |
| file_browser_field_render_old.vtl | Preserved legacy Dojo-based file browser |
| file_browser_field_render_new.vtl | New modal-based file browser implementation |
| template_custom_field_new.vtl | Removed redundant CSS styles (moved to SCSS) |
| native-field.component.scss | Added shared dropdown/select styles for custom fields |
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/content/file_browser_field_render_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/personas/keytag_custom_field_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/personas/keytag_custom_field_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/tag/tag_storage_field_creation.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/tag/tag_storage_field_creation.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/content/file_browser_field_render_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/personas/keytag_custom_field_old.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/tag/tag_storage_field_creation_old.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/personas/keytag_custom_field_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/content/file_browser_field_render_new.vtl
Show resolved
Hide resolved
...lib/fields/dot-edit-content-custom-field/components/native-field/native-field.component.scss
Outdated
Show resolved
Hide resolved
...lib/fields/dot-edit-content-custom-field/components/native-field/native-field.component.scss
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/tag/tag_storage_field_creation_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/tag/tag_storage_field_creation_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/personas/keytag_custom_field_new.vtl
Show resolved
Hide resolved
...lib/fields/dot-edit-content-custom-field/components/native-field/native-field.component.scss
Outdated
Show resolved
Hide resolved
…new-custom-field-api
There was a problem hiding this comment.
Check
- gaps
- margins
- paddings
- font sizes
- pixel values
We should use available vars for spacing and fonts and if the vars does not comply with the figma, we should review it with Melissa to see be sure if we need to use the closest one or use a custom
This is to save time when migrating as its being made with the lara theme. Its easier to match the new vars with the current ones.
There was a problem hiding this comment.
And about the pixel values, rem is more scalable, since some of our uses modify their browser font size for accessibility, so it might brake some cases if we inconsistently use pixels for positioning or sizes while preserving gaps and spacings on rem
There was a problem hiding this comment.
Done. Gaps, margins, padding, font sizes. Are now using the css vars
…new-custom-field-api
…field-api' of https://github.com/dotCMS/core into 34450-task-migrate-persona-key-tag-field-to-new-custom-field-api
Migrate Custom Fields to New Edit Mode and Consolidate Shared Styles
Summary
This PR migrates multiple custom field implementations to the new edit mode architecture, replacing legacy Dojo-based code with modern DOM manipulation and the DotCustomFieldApi framework. Additionally, shared dropdown styles have been extracted and consolidated for reusability across field types. Comprehensive accessibility improvements and code quality fixes have been applied throughout.
Changes
Custom Field Migrations
1. Personas KeyTag Field (
keytag_custom_field)New Implementation:
keytag_custom_field_new.vtlLegacy Preservation:
keytag_custom_field_old.vtlretained for backward compatibilitySwitcher Logic:
keytag_custom_field.vtlconditionally routes based onisNewEditModeEnabled()2. File Browser Field (
file_browser_field_render)New Implementation:
file_browser_field_render_new.vtlplaceholderfor URI input fieldLegacy Preservation:
file_browser_field_render_old.vtlretained for backward compatibilitySwitcher Logic:
file_browser_field_render.vtlconditionally routes based onisNewEditModeEnabled()3. Tag Storage Field (
tag_storage_field_creation)New Implementation:
tag_storage_field_creation_new.vtlLegacy Preservation:
tag_storage_field_creation_old.vtlretained for backward compatibilitySwitcher Logic:
tag_storage_field_creation.vtl(FIXED)/static/...) for consistencyDEMO
Screen.Recording.2026-02-13.at.5.21.12.PM.mov