Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Generate WP posts with rich layout including multimedia etc #4

Merged
merged 4 commits into from
Jan 24, 2022

Conversation

tamw-wnet
Copy link
Member

The NPR Story API includes a 'layout' section for most stories that references inline the placement of multimedia objects such as images, videos, Twitter embeds, javascript widgets, etc. This pull request adds the ability for the WP site admin to import stories using that rich layout including the multimedia objects, in the order they appeared in the NPR.org story. It adds a checkbox to the admin to enable this functionality. As of this commit, Slideshows are not imported, only the first image in the slideshow.

…x HTML to render any images, YouTube videos, Tweets, iframes, or JavaScript-based widgets within the post in the order they appeared on the NPR website.
…Press Media Library instead of all referenced images in the story
@tamw-wnet tamw-wnet requested a review from a team May 5, 2021 18:58
@tamw-wnet tamw-wnet added the enhancement New feature or request label May 5, 2021
@tamw-wnet tamw-wnet requested review from davidmpurdy and jwcounts and removed request for a team May 5, 2021 18:58
Copy link

@jwcounts jwcounts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, and I like that the additions are only enabled if the "layout" tag is included in the API response. I would really like to test it with data from the API, but I haven't been able to find an article with the "layout" tag available yet.

@tamw-wnet
Copy link
Member Author

@jwcounts I think you actually have to make a request to NPR to have the 'layout' stuff added to your key.

@jwcounts
Copy link

Okay, waiting to hear back from NPR Support. I'm good with merging in the meantime.

@tamw-wnet
Copy link
Member Author

I'm going to add some help text to the README and/or the settings page so people know how to enable 'layout' for their keys. "They should open a ticket requesting layout permissions for their Story API Key. Have them please provide the key in the request so we can make sure we know which one we're adding those permissions to."

@jwcounts
Copy link

jwcounts commented Jan 21, 2022 via email

Updating the text for the layout checkbox explaining that it may require a ticket with NPR to update their Story API key to get the layout section.
@tamw-wnet
Copy link
Member Author

@jwcounts I've added the help text -- I'm going to let you make that request to NPR so you can see what the behavior is with the layout stuff before pushing this forward.

Copy link

@jwcounts jwcounts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest breaking the added line into it's own paragraph, maybe bolded or italicized. You would end up with 3 paragraphs, which may make it a little more legible.

Copy link

@jwcounts jwcounts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works

@tamw-wnet tamw-wnet merged commit 9d54c1c into OpenPublicMedia:master Jan 24, 2022
@tamw-wnet tamw-wnet deleted the use_rich_layout branch March 10, 2022 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants