Skip to content

Commit cc26353

Browse files
committed
Adding insert documentation for 'content' and 'secondary-content'
1 parent edda8d4 commit cc26353

File tree

2 files changed

+88
-3
lines changed

2 files changed

+88
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
33
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## Documentation Update <sub><sup>(February 16, 2021)</sup></sub>
6+
### Changed
7+
* Added documentation for two <a href="https://dealerdotcom.github.io/web-integration-api-docs/#insert-locations">Insert Locations</a>.
8+
* <a href="https://dealerdotcom.github.io/web-integration-api-docs/#content">`content`</a> requires that a landing page be created with this target.
9+
* <a href="https://dealerdotcom.github.io/web-integration-api-docs/#secondary-content">`secondary-content`</a> is present ~2/3 of the way down on details pages.
10+
511
## Documentation Update <sub><sup>(February 5, 2021)</sup></sub>
612
### Changed
713
* Updated code examples to use modern practices.

source/includes/_locations.md

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ This element is positioned below the vehicle pricing area on vehicle search and
135135
(WIAPI => {
136136
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
137137
API.insert('vehicle-media-container', (elem, meta) => {
138-
// This element is the media gallery container on vehicle deals pages.
138+
// This element is the media gallery container on vehicle details pages.
139139
// Injecting into this location will replace the media gallery with the elements you insert.
140140
});
141141
})(window.DDC.API);
@@ -159,7 +159,43 @@ This element is positioned below the vehicle pricing area on vehicle search and
159159
})(window.DDC.API);
160160
```
161161

162-
This element is the media gallery container on vehicle deals pages. Injecting into this location will replace the media gallery with the elements you insert.
162+
This element is the media gallery container on vehicle details pages. Injecting into this location will replace the media gallery with the elements you insert.
163+
164+
## Secondary Content
165+
166+
> Usage:
167+
168+
```javascript
169+
(WIAPI => {
170+
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
171+
API.insert('secondary-content', (elem, meta) => {
172+
// This element is the a secondairy content container on vehicle details pages roughly 2/3 of the way down.
173+
// It may also be added custom two one or two stand-alone pages on the website.
174+
});
175+
})(window.DDC.API);
176+
```
177+
178+
> Example Implementation:
179+
180+
```javascript
181+
(WIAPI => {
182+
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
183+
API.subscribe('page-load-v1', ev => {
184+
if (ev.payload.detailPage) {
185+
API.insert('secondary-content', (elem, meta) => {
186+
const containerEl = document.createElement('div');
187+
containerEl.style = 'background-color: #ff0000; font-size: 30px; width: 100%; height: 540px; margin: 0 auto; padding: 100px; text-align: center;';
188+
containerEl.innerHTML = 'Your secondary content container goes here.';
189+
API.append(elem, containerEl);
190+
});
191+
}
192+
});
193+
})(window.DDC.API);
194+
```
195+
196+
By default, this element is roughly 2/3 of the way down on vehicle details pages.
197+
198+
Since this may also be present on one or two standalone pages as custom additions, it is likely you will want to target just details pages by first subscribing to the <a href="#page-load-v1">`page-load-v1`</a> event, then using the <a href="#page-event">event</a> value of `payload.detailPage` to check the page type.
163199

164200
## Primary Banner
165201

@@ -204,4 +240,47 @@ This element is positioned in a prominent location above the vehicle listings on
204240

205241
On the Details page, it is positioned at the top of the vehicle information, below the media gallery.
206242

207-
You can target either the listings or details page by first subscribing to the page-load-v1 event, and using the event values of `payload.searchPage` and `payload.detailPage` to check the page type.
243+
You can target either the listings or details page by first subscribing to the <a href="#page-load-v1">`page-load-v1`</a> event, then using the <a href="#page-event">event</a> values of `payload.searchPage` and `payload.detailPage` to check the page type.
244+
245+
## Content
246+
247+
> Usage:
248+
249+
```javascript
250+
(WIAPI => {
251+
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
252+
API.insert('content', (elem, meta) => {
253+
// This element is will only insert on to Dealer.com pages created for your purposes.
254+
// It may also be present on pages created for another integration.
255+
});
256+
})(window.DDC.API);
257+
```
258+
259+
> Example Implementation:
260+
261+
```javascript
262+
(WIAPI => {
263+
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
264+
API.subscribe('page-load-v1', ev => {
265+
if (ev.payload.pageName === 'PROMOTIONS_LANDING') {
266+
API.insert('content', (elem, meta) => {
267+
const containerEl = document.createElement('div');
268+
containerEl.classList = 'bg-neutral-950 text-light';
269+
containerEl.style = 'font-size: 35px; width: 100%; height: 540px; margin: 0 auto; padding: 100px; text-align: center;';
270+
containerEl.innerHTML = 'Your secondary content container goes here.';
271+
API.append(elem, containerEl);
272+
});
273+
}
274+
});
275+
})(window.DDC.API);
276+
```
277+
278+
On a custom landing page created for the purpose of this target, it will represent the entirety of the space between the header and footer.
279+
280+
The example implementation can be tested here:
281+
<a href="https://www.roimotors.com/promotions/index.htm?ssePageId=v9_WEB_INTEGRATION_GENERIC_FULL_WIDTH_V1_1">https://www.roimotors.com/promotions/index.htm?ssePageId=v9_WEB_INTEGRATION_GENERIC_FULL_WIDTH_V1_1</a>
282+
283+
284+
Because this will rely on the creation of a custom landing page, you will need to work with us to ensure you have a blank page with this target.
285+
286+
Once this is done, you will need to subscribe to the <a href="#page-load-v1">`page-load-v1`</a> event, then use the <a href="#page-event">event</a> value of `payload.pageName` to ensure you only target your dedicated landing page.

0 commit comments

Comments
 (0)