Skip to content

Commit 5960e82

Browse files
authored
Add insertGalleryContent documentation. Remove reference to IE11. (#4)
1 parent 856721e commit 5960e82

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

source/includes/_methods.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,47 @@ Field Name | Purpose | Field Format
159159
`intent` | The intention of the CTA you are inserting. | String
160160
`setupFunction(meta)` | The payload object for the current vehicle. | Object
161161

162+
## API.insertGalleryContent(target, objOrArray)
163+
164+
> Usage
165+
166+
```javascript
167+
(function(WIAPI) {
168+
var API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
169+
API.insertGalleryContent('vehicle-media', [
170+
{
171+
type: 'image',
172+
position: 'primary',
173+
src: 'https://yourdomain.com/primary.jpg',
174+
thumbnail: 'https://yourdomain.com/primary-thumb.jpg'
175+
},
176+
{
177+
type: 'image',
178+
position: 'secondary',
179+
src: 'https://yourdomain.com/secondary.jpg',
180+
thumbnail: 'https://yourdomain.com/secondary-thumb.jpg'
181+
},
182+
{
183+
type: 'image',
184+
position: 'last',
185+
src: 'https://yourdomain.com/last.jpg',
186+
thumbnail: 'https://yourdomain.com/last-thumb.jpg'
187+
}
188+
]);
189+
})(window.DDC.API);
190+
```
191+
192+
The `insertGalleryContent` method allows you to add media to media galleries across various pages of Dealer.com sites. The only currently supported target is `vehicle-media`, which will insert media into the media carousel of Vehicle Details Pages.
193+
194+
`objOrArray` is an array of objects describing the media to be inserted. If you have a single image, you can pass a single object instead. Each object has a `type` field to specify the type of media to be inserted. The only currently supported media type is `image`.
195+
196+
The `image` type supports the following additional attributes:
197+
198+
Name | Description
199+
-------------- | --------------
200+
`position` | Where to insert the image. `primary` is used for content that should be displayed to the user as soon as it loads -- as long as the user has not explicitly performed an action to look at pre-existing media. `secondary` is used for content that should be displayed soon, but not replace the pre-existing main image. `last` is used to append content to the end of an existing gallery.
201+
`src` | HTTPS url to the image to be inserted.
202+
`thumbnail` | HTTPS url to a thumbnail of the image to be inserted. For performance, it is ideal to provide a low resolution thumbnail that can be used for a preview of the inserted image, however, `src` will be used if `thumbnail` is not provided.
162203

163204
## API.insert(name, callback(elem, meta))
164205

source/includes/_requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Your code should be minimal and perform only actions necessary to bootstrap your
5656

5757
* **Avoid Duplicate Code** - Please refrain from including large libraries such as jQuery or React, as both are already available on all pages of all of our sites. Avoid polyfilling items that DDC already polyfills.
5858

59-
* **Browser Support** - We strive to support IE11, Edge, Firefox, Chrome, Safari, and iOS Safari, however, you may choose your own level of support.
59+
* **Browser Support** - We strive to support Edge, Firefox, Chrome, Safari, and iOS Safari, however, you may choose your own level of support.
6060

6161
* **Minimize Files** - Serve content from as few files as possible to allow for optimal downloads.
6262

0 commit comments

Comments
 (0)