diff --git a/README.md b/README.md index 17259be..5b6fd1c 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,15 @@ Directly from unpkg.com | width | Number | Banner width | | height | Number | Banner height | | id | String | The slot ID for this banner | -| category-id | Optional String | The category ID of the current page | -| category-ids | Optional String | Comma (,) separated list of category IDs, the item must match all | -| category-disjunctions | Optional String | Comma (,) separated list of category IDs, the item must match any | +| category-id* | Optional String | The category ID of the current page | +| category-ids* | Optional String | Comma (,) separated list of category IDs, the item must match all | +| category-disjunctions* | Optional String | Comma (,) separated list of category IDs, the item must match any | | search-query | Optional String | The search query of the current page | | location | Optional String | The location for geotargeting | +\* Only one of `[category-id, category-ids, category-disjunctions]` must be set. +If multiple are set, only the first will be considered, in that order. + # Banner Behaviors | Function Name | Arg type | Return Type | Description | diff --git a/src/index.ts b/src/index.ts index 700d6c5..37100d7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -208,11 +208,11 @@ export class TopsortBanner extends LitElement { }; } else if (this.categoryIds) { auction.category = { - ids: this.categoryIds.split(","), + ids: this.categoryIds.split(",").map((item) => item.trim()), }; } else if (this.categoryDisjunctions) { auction.category = { - disjunctions: this.categoryDisjunctions.split(","), + disjunctions: this.categoryDisjunctions.split(",").map((item) => item.trim()), }; } else if (this.searchQuery) { auction.searchQuery = this.searchQuery;