ampproject / ampproject/amphtml

Templates in AMP4EMAIL are more constrained. You can have a dynamic `href` but the entire attribute value must be replaced:

Open
#38,641 1 comment 0 reactions 0 assignees View on GitHub
P3: When Possible Type: Feature Request WG: amp4email
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Is this still supported? I am trying to dynamically set the URL using amp-bind based on form input values but the AMP validator gives the error message: The relative URL '{{myState.url}}' for attribute 'href' in tag 'a' is disallowed.

Templates in AMP4EMAIL are more constrained. You can have a dynamic `href` but the entire attribute value must be replaced:

```html




```

Hope that helps!

_Originally posted by @dreamofabear in https://github.com/ampproject/amphtml/issues/19741#issuecomment-445994469_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the AMP4EMAIL case with amp-bind, a form-derived value, and a dynamic href, then run the AMP validator to confirm the reported relative-URL error. Check whether the documented whole-attribute replacement rule still applies; done means the supported behavior and any required validator or documentation change are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.