From 9b26981a291c77d2e7823d38eb6634296d66d8de Mon Sep 17 00:00:00 2001 From: Nicolas Molina Monroy Date: Tue, 21 Apr 2026 13:24:16 -0700 Subject: [PATCH] fix(url-title): enhance suggestion display logic in url-title_old.vtl --- .../static/htmlpage_assets/url-title_old.vtl | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/url-title_old.vtl b/dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/url-title_old.vtl index 04b101f69226..f912af6cd733 100644 --- a/dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/url-title_old.vtl +++ b/dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/url-title_old.vtl @@ -23,14 +23,21 @@ if (!newSlug || newSlug === currentValue) { suggestion.style.display = 'none'; + suggestion.innerHTML = ''; return; } - suggestion.innerHTML = ` - - Use: ${newSlug} - - `; + suggestion.innerHTML = ''; + + const link = document.createElement('a'); + link.href = '#'; + link.textContent = `Use: ${newSlug}`; + link.addEventListener('click', event => { + event.preventDefault(); + applySuggestion(newSlug); + }); + + suggestion.appendChild(link); suggestion.style.display = 'block'; }; @@ -65,13 +72,14 @@ const newSlug = slugifyText(value); showSuggestion(newSlug); }); + + input.addEventListener('keyup', handleInput); });