1
votes

AMP validator shows me the following error:

The tag 'amp-social-share' may not appear as a descendant of tag 'amp-sidebar'.

Honestly I do not understand a reason for such restriction. For example I want to show narrow sidebar on right when user clicks on the "share" icon; and the sidebar should have several amp-social-share items.

Why I can't do it?

UPDATE

AMP project team decided to remove this restriction. Details here: https://github.com/ampproject/amphtml/issues/4273

1

1 Answers

0
votes

It is stated in this documentation that the amp-sidebar may not contain any AMP Elements except for amp-accordion, amp-img and amp-fit-text. So that is the reason you get this error because you put amp-social-share under the amp-sidebar.

Also take note that there can be only one amp-sidebar in an AMP document. The amp-sidebar should be a direct child of the <body>. It must have a layout of no display.