Skip to content

Commit 44fcf93

Browse files
authored
Merge pull request #19 from DealerDotCom/feature/link-update
Doc for updateLink
2 parents 7a9f6f3 + 866b2f4 commit 44fcf93

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Diff for: source/includes/_internal.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
# DDC Specific Documentation
22

3-
## Content Modification
3+
## API.updateLink(intent, setupFunction(meta))
4+
The `updateLink` method is used to override links on the page where the integration is enabled.
5+
In order to use this functionality the integration's schema in WISE needs to have a content mapping entry with the content type as `links`.
6+
The purpose of content needs to be the overriding links functionality (eg, X-Time). Then we just need to select all the PageAlias that we would like to target.
7+
The PageAlis list can be overriden in the site level to capture any sitebuilder pages as well.
8+
9+
The WIAPI would deduce the link of the corresponding PageAlias in the site level letting you to modify the link element.
10+
11+
Currently, we support `x-time` and `schedule-service` link intents.
12+
13+
And, we only support limited attributes of the link to be modified in order to preserve the look and feel of the link.
14+
The attributes that can be modified are `href`, `target`, `onclick`, `popover` and `attributes (data-*)`.
15+
16+
> Usage:
17+
18+
```javascript
19+
(async APILoader => {
20+
const API = await APILoader.create(document.currentScript);
21+
API.updateLink('x-time', meta => {
22+
return {
23+
href: 'https://www.yourdomain.com/?account=' + meta.accountId,
24+
target: '_blank',
25+
}
26+
});
27+
})(window.DDC.APILoader);
28+
```
29+
30+
## Content Modification (deprecated)
31+
32+
The `updateLink` method would be replacing this functionality.
433

534
This method allows you to modify content on a page level. Right now we only support the modification of the `schedule-service` button. So, by using this method you would be able to modify the link attributes of all the schedule service buttons on a page.
635

0 commit comments

Comments
 (0)