ampproject / ampproject/amphtml

Allow variable substitution on data-param-* attributes

Open
#30,068 3 comments 0 reactions 1 assignee Claimed by @alanorozco View on GitHub
Component: amp-youtube P2: Soon Stale Type: Feature Request WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## Describe the new feature or change to an existing feature you'd like to see

Since data-param-* attributes will be added as a query parameter for URLs, would be nice to allow variable substitution for them when they are added as query params.

## Additional context

I ran into this need when adding embed_config attribute for amp-youtube, I need to include a value stored in an AMP variable, something like this:

```

```

And the variable is not substituted on the parameter of the request, the URL keeps literally "${ampVariableName}"

```
https://www.youtube.com/get_video_info?html5=1&video_id=i3LHatq2u4k&embed_config={"adsConfig":{"adTagParameters":{"rdp":"${ampVariableName}"}}}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.