amp-wp icon indicating copy to clipboard operation
amp-wp copied to clipboard

Support amp-playbuzz component

Open lysk88 opened this issue 9 years ago • 2 comments

Playbuzz Content can be embedded by using code snippet (including Script element, that can reside in the head element and div with class="pb_feed").

Issue

Playbuzz items being embedded with code snippet are not being transformed to amp-playbuzz component.

Steps required to reproduce Issue

  1. Install amp-wp Plugin
  2. Create a new WP post
  3. Embed a Playbuzz item via code snippet (see below code snippet for example)
  4. Published AMP post via amp-wp plugin
  5. The new AMP post doesn't contain Playbuzz embedded item

Suggested solution

Support Playbuzz out of the box

  1. Playbuzz embed handler should be part of the default embed handlers.
  2. Playbuzz embed handler should support amp-playbuzz attributes

Instructions on how to transform code snippet to amp component

Code snippet

<script type="text/javascript" src="//cdn.playbuzz.com/widget/feed.js"></script>
<div class="pb_feed"  data-item="3103bc0a-4633-43e6-8ca9-ae005551924d" data-game="HistoryUK/10-classic-christmas-movies" data-game-info="false" data-shares="true" data-comments="false"></div>

Should be converted to

<amp-playbuzz src="https://www.playbuzz.com/HistoryUK/10-classic-christmas-movies" data-item="a6aa5a14-8888-4618-b2e3-fe6a30d8c51b" height="500" data-item-info="false" data-share-buttons="true" data-comments="false"></amp-playbuzz>

Attributes to convert

data-item ( only if code snippet contains data-item )

  • Take the value from the code snippet attribute data-item.

src ( only if code snippet contains data-game )

  • Take the value from the code snippet attribute data-game and prefixing with www.playbuzz.com Example:

Code snippet


data-game="HistoryUK/10-classic-christmas-movies"

Should be converted to

src="//www.playbuzz.com/HistoryUK/10-classic-christmas-movies"

height

  • Value should be 500.

data-item-info ( only if code snippet contains data-game-info )

  • Take the value from the code snippet attribute data-game-info.

data-share-buttons ( only if code snippet contains data-shares )

  • Take the value from the code snippet attribute data-shares.

data-comments ( only if code snippet contains data-comments )

  • Take the value from the code snippet attribute data-comments.

lysk88 avatar Feb 27 '17 11:02 lysk88

It looks like with the merge of #664 this can be closed?

rudygalfi avatar Apr 04 '17 16:04 rudygalfi

Yep.

mjangda avatar Apr 04 '17 16:04 mjangda