spicywebau / craft-embedded-assets

Manage YouTube videos, Instagram photos, Twitter posts and more as first class assets in Craft CMS
MIT License
171 stars 34 forks source link

How to remove frameborder attribute from iframe? #216

Closed OneX closed 1 year ago

OneX commented 2 years ago

Description

When Craft GraphQL return the iframeCode it includes the frameborder attribute. This is provoking the following w3 validation error:

Error: The frameborder attribute on the iframe element is obsolete. Use CSS instead.

Is there a way to remove that attribute from iframe code?

Steps to reproduce

  1. Check iframeCode in GraphQL query

Other information

ttempleton commented 2 years ago

There's currently no in-built way to remove iframe attributes, but that's something we can look at for a future release.

ttempleton commented 1 year ago

Just released Embedded Assets 3.0.5 - iframeCode now accepts a removeAttributes argument which is an array of the attributes you want to remove, e.g.:

assetField {
  embeddedAsset {
    iframeCode(removeAttributes: ["frameborder"])
  }
}
OneX commented 1 year ago

@ttempleton great. Thanks for informing us.