Skip to content

Commit

Permalink
♻️readmo: change data-url from required to optional (#27536)
Browse files Browse the repository at this point in the history
Co-authored-by: Kieran Boyle <kboyle@verizonmedia.com>
  • Loading branch information
dysfunc and Kieran Boyle committed May 26, 2020
1 parent 74a56e9 commit e5c5617
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ads/readmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ import {loadScript, validateData} from '../3p/3p';
* @param {!Object} data
*/
export function readmo(global, data) {
validateData(data, ['section', 'url']);
validateData(data, ['section']);

const config = {
container: '#c',
amp: true,
};

global.publisherUrl = data.url;
if (data.url) {
global.publisherUrl = data.url;
}

Object.keys(data).forEach((property) => {
config[property] = data[property];
Expand Down
3 changes: 1 addition & 2 deletions ads/readmo.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ ReadMo only requires a section code to run. Please work with your account manage
height="320"
type="readmo"
layout="responsive"
data-url="https://yourdomain.com"
data-infinite="true"
data-section="1234567"
>
Expand All @@ -38,12 +37,12 @@ ReadMo only requires a section code to run. Please work with your account manage
### Required parameters

- `data-section` : A unique identifier that represents your site and placement
- `data-url` : The url that the section is allowed to run on

### Optional parameters

- `data-module` : Defines the type of module to render (`end-of-article`, `smart-feed`, `smart-feed-video`, `side-rail`)
- `data-infinite` : If true, enables infinite feed for your module
- `data-title` : The title that appears above the module (defaults to "You May Like")
- `data-sponsored-by-label` : Text override to the default "Sponsored by" label that appears next to the sponsors name
- `data-url` : Publisher url override
- `json` : Use this to pass additional configuration properties (ex: `json='{ "contentId": 1234 }'`)

0 comments on commit e5c5617

Please sign in to comment.