Edit links
Is this page helpful?
<body>
, specify the environment ID using data-kontent-project-id="1d50a0f7-9033-48f3-a96e-7771c73f9683"
and language using data-kontent-language-codename="en-US"
.<div>
, specify the content item ID using data-kontent-item-id="af858748-f48a-4169-9b35-b10c9d3984ef"
.<p>
, specify the codename of an element using data-kontent-element-codename="body"
.https://app.kontent.ai/goto/edit-item/project/1d50a0f7-9033-48f3-a96e-7771c73f9683/variant-codename/default/item/af858748-f48a-4169-9b35-b10c9d3984ef/element/body
.
You can also specify identifiers for content components using data-kontent-component-id
so that your content creators can enjoy an even better editing experience.
For more specific steps and examples, check out the Smart Link SDK usage instructions.
data-kontent-element-codename
.data-kontent-add-button
to allow rendering of the Add button.data-kontent-add-button-render-position
to specify the exact location of the Add button on preview.data-kontent-add-button-insert-position=start|end
.data-kontent-add-button-insert-position=before|after
accompanied by data-kontent-item-id
or data-kontent-component-id
that specifies a linked item or a component before or after which you want to add new content.https://app.kontent.ai/goto/edit-item/project/<YOUR_ENVIRONMENT_ID>/variant-codename/<LANGUAGE_CODENAME>/item/<ITEM_ID>
https://app.kontent.ai/goto/edit-item/project/8d20758c-d74c-4f59-ae04-ee928c0816b7/variant-codename/en-US/item/4d4dc14d-8c7c-471f-b797-c6694c604964
https://app.kontent.ai/goto/edit-item/project/<YOUR_ENVIRONMENT_ID>/variant-codename/<LANGUAGE_CODENAME>/item/<ITEM_ID>/element/<ELEMENT_CODENAME>
https://app.kontent.ai/goto/edit-item/project/8d20758c-d74c-4f59-ae04-ee928c0816b7/variant-codename/en-US/item/4d4dc14d-8c7c-471f-b797-c6694c604964/element/related_articles
X-KC-Wait-For-Loading-New-Content
header to true
when fetching data from the Delivery Preview API.# Pattern
https://app.kontent.ai/goto/edit-item/project/<YOUR_ENVIRONMENT_ID>/variant-codename/<LANGUAGE_CODENAME>/item/<ITEM_ID>/element/<ELEMENT_CODENAME>/item/<NESTED_ITEM_ID>/element/<ELEMENT_CODENAME>
# Example
https://app.kontent.ai/goto/edit-item/project/8d20758c-d74c-4f59-ae04-ee928c0816b7/variant-codename/en-US/item/4d4dc14d-8c7c-471f-b797-c6694c604964/element/related_articles/item/29b82988-fb9e-4327-a34b-b568cfaa39e9/body
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import KontentSmartLink, { KontentSmartLinkEvent } from '@kontent-ai/smart-link';
const sdk = KontentSmartLink.initialize({ ... });
sdk.on(
KontentSmartLinkEvent.Refresh,
(data, metadata, originalRefresh) => {
// Custom refresh logic goes here
// ...
originalRefresh(); // If you want to refresh the page at the end
}
);