Amphtml: AMP4EMAIL: href attributes can't be dynamic?

Created on 8 Dec 2018  路  4Comments  路  Source: ampproject/amphtml

I'm building an email template under AMP4Email developer preview. I wonder if there is a way to make links dynamic in templates or via state.

<amp-list ...>
  <template ...>
    <a href="https://example.com/{{id}}">  <!-- not supported -->
        ...
    </a>
  </template>
</amp-list>
  <a [href]="'https://example.com/' + state.id">  <!-- definitely not supported -->
    ...
  </a>

So, I was wondering that from a list of items which are dynamically fetched from an API (hence the whole link is not pre-known), there is no way to give a link to each specific item with the help of data fetched? How does one navigate to such a URL?

DiscussioQuestion amp4email

Most helpful comment

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

<amp-list ...>
  <template ...>
    <a href="https://example.com/{{id}}"></a>  <!-- not supported -->
    <a href="{{url}}"></a>  <!-- supported -->
  </template>
</amp-list>

Hope that helps!

All 4 comments

Triaging to @choumx feel free to re-assign 馃槃

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

<amp-list ...>
  <template ...>
    <a href="https://example.com/{{id}}"></a>  <!-- not supported -->
    <a href="{{url}}"></a>  <!-- supported -->
  </template>
</amp-list>

Hope that helps!

Thanks so much for the detailed description. That clears things up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radiovisual picture radiovisual  路  3Comments

mrjoro picture mrjoro  路  3Comments

choumx picture choumx  路  3Comments

jpettitt picture jpettitt  路  3Comments

sryze picture sryze  路  3Comments