Skip to content

Some shortcode parameters are not working for some documentsΒ #52

@jaredcobb

Description

@jaredcobb

It seems that some of the shortcode parameters (for example height, width, zoom, page, and a few others) are not consistently working on some documents.

Steps to reproduce:

  1. Add the following shortcode to a post:
[documentcloud url="https://www.documentcloud.org/documents/2746909-ABCC-List.html" responsive="false" width="400" height="400" page="3" zoom="false" /]
  1. The plugin will make an API call like so:
https://www.documentcloud.org/api/oembed.json?maxwidth=400&maxheight=400&url=https://www.documentcloud.org/documents/2746909-ABCC-List.html?page=3&zoom=false&responsive=false
  1. The API response will be:
{
    "type": "rich",
    "version": "1.0",
    "provider_name": "DocumentCloud",
    "provider_url": "https://www.documentcloud.org",
    "cache_age": 300,
    "height": 400,
    "width": 400,
    "html": "<div class=\"DC-embed DC-embed-document DV-container\"> <div style=\"position:relative;padding-bottom:141.2857142857142%;height:0;overflow:hidden;max-width:100%;\"> <iframe src=\"//www.documentcloud.org/documents/2746909-ABCC-List.html?embed=true&amp;notes=false&amp;page=3&amp;pdf=false&amp;responsive=false&amp;search=false&amp;sidebar=false&amp;text=false&amp;zoom=false\" title=\"ABCC-List (Hosted by DocumentCloud)\" sandbox=\"allow-scripts allow-same-origin allow-popups\" frameborder=\"0\" style=\"position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #aaa;border-bottom:0;box-sizing:border-box;\"></iframe> </div> </div>"
}
  1. Note a few things about the html value...
  • The inline style attribute is set at 100% width and 100% height (even though the JSON response shows 400 x 400.
  • The iframe src value properly renders zoom=false however the Zoom slider control will still show up.
  • The iframe src value properly renders page=3 however the document will not default to Page 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions