Skip to content

fix: use rewrite_url/1 for teaser images#3088

Merged
thecristen merged 3 commits intomainfrom
cbj/teaser-image-url
Apr 6, 2026
Merged

fix: use rewrite_url/1 for teaser images#3088
thecristen merged 3 commits intomainfrom
cbj/teaser-image-url

Conversation

@thecristen
Copy link
Copy Markdown
Collaborator

@thecristen thecristen commented Apr 6, 2026

Scope

In this Slack thread it was shared that the first image in the right rail on the World Cup Guide page directly points to our Drupal URL, which we generally avoid doing around here.

Implementation

We usually rewrite content URLs to avoid that, but there was a spot we missed. Each content type seems to be handled in its own way so this took a while to track down. But this was a teaser of a page rendered within a ContentList.

edit in second commit: should apply to any image parsed from a Teaser.

How to test

Go to http://localhost:4001/guides/world-cup-guide (or deploy it and go to that path there) and see the src of the image is a relative URL rather than an absolute URL to pantheon.io. Another example is the related project at /projects/green-line-c-branch-station-accessibility-improvements.

@thecristen thecristen requested review from a team and amaisano as code owners April 6, 2026 20:11
@thecristen thecristen requested a review from lvachon1 April 6, 2026 20:11
@thecristen thecristen enabled auto-merge (squash) April 6, 2026 20:23
@thecristen thecristen merged commit 6db503c into main Apr 6, 2026
17 checks passed
@thecristen thecristen deleted the cbj/teaser-image-url branch April 6, 2026 20:30
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.

2 participants