AMP

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

amp-vk

Description

Embeds a VK post or poll widget.

 

Required Scripts

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

Supported Layouts

Behavior

You can use the amp-vk component to embed a VK post or poll widget.

Example of a post widget:

<amp-vk
  width="500"
  height="300"
  data-embedtype="post"
  layout="responsive"
  data-owner-id="1"
  data-post-id="45616"
  data-hash="Yc8_Z9pnpg8aKMZbVcD-jK45eAk"
>
</amp-vk>

Example of a poll widget:

<amp-vk
  width="400"
  height="300"
  layout="responsive"
  data-embedtype="poll"
  data-api-id="6183531"
  data-poll-id="274086843_1a2a465f60fff4699f"
>
</amp-vk>

Attributes

For additional information about widgets attributes, please see VK post widget documentation and VK poll widget documentation.

data-embedtype (required) The type of embed, either `post` or `poll`.
data-owner-id Owner id of a vk.com post. Supported when `data-embedtype` is `post`.
data-post-id Post id of a post. Supported when `data-embedtype` is `post`.
data-hash Security hash for the widget connection. Supported when `data-embedtype` is `post`.
data-api-id API id of a poll. Supported when `data-embedtype` is `poll`.
data-poll-id Id of a poll. Supported when `data-embedtype` is `poll`.
common attributes This element includes [common attributes](https://amp.dev/documentation/guides-and-tutorials/learn/common_attributes) extended to AMP components.

Validation

See amp-vk rules in the AMP validator specification.

도움이 더 필요하신가요?

이 문서를 수십 번 읽었음에도 여전히 궁금한 점이 남아 있나요? 다른 개발자들도 같은 심정일지 모릅니다. Stack Overflow에서 소통해 보세요.

Stack Overflow로 이동
버그나 누락된 기능을 발견하셨나요?

AMP 프로젝트는 여러분의 참여와 기여를 적극 환영합니다! 오픈 소스 커뮤니티를 통해 지속적으로 활동해 주셔도 좋지만 관심 있는 주제에 한 번만 기여하셔도 큰 도움이 됩니다.

GitHub로 이동하기