Skip to content

Conversation

@rjvelazco
Copy link
Contributor

@rjvelazco rjvelazco commented Dec 26, 2025

We’re porting this behavior from the old editor. See the relevant implementation here:
dot-edit-content-html.service.ts (lines 921–946)

Videos

Issue

issue.mov

Fix

video.mov

This PR fixes: #34174

This PR fixes: #34174

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 fixes broken content navigation when using relative paths/URLs in the Universal Visual Editor (UVE) by injecting a <base> tag into rendered HTML pages. When pages are displayed in iframes without a base tag, relative links fail to resolve correctly, breaking navigation. The solution dynamically calculates and injects an appropriate base href to ensure relative URLs resolve properly within the iframe context.

Key Changes

  • Added getBaseHrefFromPageURI() utility to compute the correct base href from a page URI and origin
  • Added injectBaseTag() utility to inject base tags into HTML when missing
  • Integrated base tag injection into the VTL code injection pipeline in EditEmaEditorComponent

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
core-web/yarn.lock Cleanup of duplicate and wildcard dependency entries for better deterministic resolution
core-web/libs/portlets/edit-ema/portlet/src/lib/utils/index.ts Added base tag helper functions to compute and inject base tags into HTML
core-web/libs/portlets/edit-ema/portlet/src/lib/utils/utils.spec.ts Added comprehensive unit tests for the new base tag helper functions
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts Integrated base tag injection into the VTL code injection pipeline
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.spec.ts Added test to verify base tag injection is called with correct parameters

@rjvelazco rjvelazco added this pull request to the merge queue Dec 29, 2025
Merged via the queue into main with commit 6e7c3f1 Dec 29, 2025
18 checks passed
@rjvelazco rjvelazco deleted the issue-34174-defect-uve-broken-content-navigation-due-to-missing-base-tag-or-incorrect-path-resolution branch December 29, 2025 04:59
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.

[DEFECT] UVE: Broken Content Navigation due to Missing Base Tag or Incorrect Path Resolution

5 participants