Skip to content

Conversation

@nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Dec 16, 2025

Proposed Changes

This pull request introduces significant improvements to the custom field rendering logic, focusing on modularizing template and cache TTL field implementations for new and old edit modes, and enhancing the styling and maintainability of the dot-edit-content-custom-field native field component. The most important changes are grouped below:

Edit Mode Custom Field Rendering

  • Refactored cachettl_custom_field.vtl and template_custom_field.vtl to delegate rendering to separate files based on whether the new edit mode is enabled, improving maintainability and paving the way for further enhancements. [1] [2]
  • Added cachettl_custom_field_new.vtl and cachettl_custom_field_old.vtl to separate the logic for the cache TTL custom field between new (using DotCustomFieldApi) and old (using Dojo/dijit) edit modes, ensuring compatibility and cleaner code. [1] [2]

Styling Improvements

  • Added a new SCSS stylesheet (native-field.component.scss) for the dot-edit-content-custom-field native field component, centralizing and modernizing the styling for inputs, selects, textareas, and buttons, and making use of design tokens and mixins for consistency.
  • Updated the Angular component (native-field.component.ts) to include the new SCSS file, ensuring the new styles are applied.

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

This PR fixes: #34029

…dit mode support

- Updated the title custom field template to support a new edit mode using the `DotCustomFieldApi`.
- Implemented event listeners for the title box to automatically update the URL and friendly name fields based on the title input.
- Improved code structure by separating logic for new edit mode and legacy Dojo implementation.
- Ensured backward compatibility by maintaining the original script for non-edit mode scenarios.

This change enhances user experience by providing real-time updates and a more modern approach to handling custom fields.
@nicobytes nicobytes linked an issue Dec 16, 2025 that may be closed by this pull request
10 tasks
@nicobytes nicobytes requested a review from Copilot December 16, 2025 15:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors custom field implementations for HTML pages by introducing a new edit mode that uses modern JavaScript APIs instead of legacy Dojo/Dijit frameworks. The refactoring creates separate implementations for old and new edit modes, with a Velocity conditional to route between them.

Key changes:

  • Migrates from Dojo/Dijit to native JavaScript and DotCustomFieldApi
  • Adds styling for native HTML form elements in Angular components
  • Separates legacy (_old.vtl) and modern (_new.vtl) implementations

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
title_custom_field.vtl Conditional routing between old and new implementations
title_custom_field_old.vtl Legacy Dojo-based title field implementation
title_custom_field_new.vtl Modern DotCustomFieldApi-based title field implementation
template_custom_field.vtl Conditional routing between old and new implementations
template_custom_field_old.vtl Legacy Dojo-based template selector implementation
template_custom_field_new.vtl Modern implementation with native select and custom styling
cachettl_custom_field.vtl Conditional routing between old and new implementations
cachettl_custom_field_old.vtl Legacy Dojo-based cache TTL field implementation
cachettl_custom_field_new.vtl Modern DotCustomFieldApi-based cache TTL implementation
native-field.component.ts Added SCSS stylesheet reference
native-field.component.scss Added comprehensive styling for native form elements
Comments suppressed due to low confidence (1)

dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl:1

  • This comment in the SCSS file (line 5 of native-field.component.scss) is in Spanish. Translate to English: "Use ::ng-deep to apply styles to dynamically injected elements" for consistency with the rest of the codebase.
<style>

@nicobytes nicobytes changed the title refactor(custom-fields): refactor(custom-fields): Update static Custom fields Dec 17, 2025
@nicobytes nicobytes marked this pull request as ready for review December 17, 2025 10:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 16 comments.

@alwaysmeticulous
Copy link

Meticulous was unable to execute a test run for this PR because the most recent commit is associated with multiple PRs. To execute a test run, please try pushing up a new commit that is only associated with this PR.

Last updated for commit f3fb68e. This comment will update as new commits are pushed.

@mergify mergify bot mentioned this pull request Dec 17, 2025
3 tasks
@nicobytes nicobytes enabled auto-merge December 17, 2025 14:19
@nicobytes nicobytes added this pull request to the merge queue Dec 17, 2025
Merged via the queue into main with commit 68f5053 Dec 17, 2025
39 checks passed
@nicobytes nicobytes deleted the 34029-task-migrate-pages-vtls-to-new-api branch December 17, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Migrate "Pages" VTLs to new API

4 participants