amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Choose a specific slide in <amp-carousel> at page load based on query parameters

Open eric30 opened this issue 8 years ago • 5 comments

What's the issue?

I was asked if it's possible to choose a specific slide in based on the query parameter / anchor in the URL. Check out these pages:

https://campaign.simpleskincare.tw/Kind-to-Skin/#product_1 https://campaign.simpleskincare.tw/Kind-to-Skin/#product_2 https://campaign.simpleskincare.tw/Kind-to-Skin/#product_3

It dynamically decides which slide is going to be shown in the JS when the page gets loaded, and it's currently not possible with AMP.

How do we reproduce the issue?

By visiting links above ;)

What browsers are affected?

All

Which AMP version is affected?

1513979839742

eric30 avatar Jan 04 '18 05:01 eric30

Seems like an extension of https://github.com/ampproject/amphtml/issues/12591 ?

cathyxz avatar Jan 04 '18 22:01 cathyxz

Yup, similar to #12591. Thanks for pointing that out.

eric30 avatar Jan 07 '18 16:01 eric30

It's implicit in this and #12591 but we the carousel should be able to update the URL too.

This should support query params (as per the title of the FR), fragments (which is what this FR is actually asking for), and also URL rewrites (using the history API).

Updating the URL query params or fragment will require something a bit more sophisticated than bind.

Example: https://adventure.howstuffworks.com/10-eerie-abandoned-cities-can-visit3.htm

jamesshannon avatar Jan 23 '18 19:01 jamesshannon

Any progress on this?

AcidRaZor avatar Jan 18 '19 09:01 AcidRaZor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 30 '21 06:01 stale[bot]