Search code examples
amp-html

AMP Twitter fallback when tweet deleted


I'm trying to add the Twitter AMP component to a page, however I'm trying to figure out how to deal with tweets that were deleted. I know it's possible to set a <blockquote> placeholder, but unfortunately, due to my set up, I only get the URL of the tweet, which cannot to be used to access the tweet and get the text.

I've tried using the <blockquote> to display an error message, which seemed to work, however when tested with a tweet that exists, the error message/placeholder is still displayed, until the component is fully loaded.

Is there a different way of displaying an error message? It seems like only Facebook has built in functionality for this. Alternatively, can anyone think of a way to hide the <blockquote> error message until the component is fully loaded (preferably in CSS).

Here's the current behaviour.


Solution

  • This is currently not possible as amp-twitter does not support placeholder elements. I've created a feature request for the AMP runtime.