#BlackLivesMatter
Do you build things with AMP? Fill out the new AMP Developer Survey!
AMP

Important: this documentation is not applicable to your currently selected format email!

amp-beopinion

Description

Embeds BeOpinion content.

Required Scripts

<script async custom-element="amp-beopinion" src="https://cdn.ampproject.org/v0/amp-beopinion-0.1.js"></script>

Behavior

The amp-beopinion component allows you to embed BeOpinion content in your AMP page for a given BeOpinion account. BeOpinion is a tool for content creators to add interactive blocks such as polls and quizzes to their pages. BeOpinion mostly works with journalists of major media groups in Europe.

Integration examples

As a 3rd party

<amp-beopinion
  width="375"
  height="472"
  layout="responsive"
  data-account="589446dd42ee0d6fdd9c3dfd"
  data-content="5a703a2f46e0fb00016d51b3"
  data-name="content-slot"
>
</amp-beopinion>

As an ad provider

<amp-ad
  width="300"
  height="220"
  type="beopinion"
  layout="responsive"
  data-account="589446dd42ee0d6fdd9c3dfd"
  data-name="slot_0"
  data-my-content="0"
>
</amp-ad>

Appearance

BeOpinion does not currently provide an API that yields fixed aspect ratio for embedded contents. Currently, AMP automatically proportionally scales the content to fit the provided size, but this may yield less than ideal appearance. You might need to manually tweak the provided width and height. Also, you can use the media attribute to select the aspect ratio based on the screen width.

Placeholders & fallbacks

An element marked with a placeholder attribute displays while the content for the content is loading or initializing. Placeholders are hidden once the AMP component's content displays. An element marked with a fallback attribute displays if amp-beopinion isn't supported by the browser or if the content doesn't exist or has been deleted.

Visit the Placeholders & fallbacks guide to learn more about how placeholders and fallbacks interact for the amp-beopinion component.

Attributes

data-account (required) The ID of the BeOpinion account (page owner).
data-content (optional) The ID of the BeOpinion content to be displayed on the page.
data-name (optional) The name of the BeOpinion slot on the page.
data-my-content (optional - amp-ad only !) For amp-ad elements of type beopinion, the value can be set to "0" (default value).
the amp-beopinion element overrides this value to "1", to prevent the serving of ads outside of an amp-ad element.
common attributes This element includes common attributes extended to AMP components.

Validation

See amp-beopinion rules in the AMP validator specification.

需要更多帮助?

您多次阅读的资料未能涵盖您的所有问题?也许其他人也这么觉得 在 Stack Overflow 上与他们取得联系。

前往 Stack Overflow
找到一个 bug 或者缺失某项功能?

AMP 项目强烈鼓励您参与其中并作出贡献!我们希望您能成为我们开源社区的持续参与者,但我们也欢迎您对热衷问题做出单次贡献。

前往 GitHub