Resolve linked content
Is this page helpful?
jane
in our example) will appear in the value
of your author
element. If you had multiple authors, they would appear in the same order in the author
element as they do in the UI.
Jane's name and bio will appear in the modular_content
collection under her codename. So to use Jane within your article, all you have to do is match the codename from the author
element with the values you want to use from the jane
collection.
travel_insurance
, for example) will appear in the value
of the navigation_links
element. They appear in the same order in the navigation_links
element as they do in the UI.
You can find the details about each type of insurance page in the modular_content
collection.
{
"item": {
"system": {
"id": "4735c956-4be4-482c-b874-bba201a22f44",
"name": "The Origin of Coffee",
"codename": "the_origin_of_coffee",
"language": "en-US",
"type": "simple_article",
"sitemap_locations": [],
"last_modified": "2020-02-03T12:36:02.7767984Z"
},
"elements": {
"title": {
"type": "text",
"name": "Title",
"value": "The Origin of Coffee"
},
"author": {
"type": "modular_content",
"name": "Author",
"value": [
"jane_doe"
]
},
"body": {
"type": "rich_text",
"name": "Body",
"images": {},
"links": {},
"modular_content": [],
"value": "<p>The history of coffee is patchy and full of myth and hearsay. Although it's far more likely that uses for coffee were developed over time and were discovered by people tasting various parts of the cherry, the old fables do add a bit of romance and are very cute.</p>"
}
}
},
"modular_content": {
"jane_doe": {
"system": {
"id": "3bf1c09b-4552-4e2c-8de5-ffce79f773e0",
"name": "Jane Doe",
"codename": "jane_doe",
"language": "en-US",
"type": "author",
"sitemap_locations": [],
"last_modified": "2020-02-03T12:30:14.641708Z"
},
"elements": {
"name": {
"type": "text",
"name": "Name",
"value": "Jane Doe"
},
"bio": {
"type": "rich_text",
"name": "Bio",
"images": {},
"links": {},
"modular_content": [],
"value": "<p>Jane is a fun-loving writer who enjoys her coffee black as hell, strong as death, and sweet as love.</p>"
}
}
}
}
}
{
"item": {
"system": {
"id": "47e1a69d-9205-4be4-9ce9-78042dd4560b",
"name": "Insurance listing",
"codename": "insurance_listing",
"language": "default",
"type": "page",
"sitemap_locations": [],
"last_modified": "2020-09-02T12:24:44.4297022Z"
},
"elements": {
"title": {
"type": "text",
"name": "Title",
"value": "Insurance listing"
},
"url": {
"type": "url_slug",
"name": "URL",
"value": "insurance-listing"
},
"show_in_navigation": {
"type": "multiple_choice",
"name": "Show in navigation",
"value": [
{
"name": "Yes",
"codename": "yes"
}
]
},
"navigation_links": {
"type": "modular_content",
"name": "Subpages",
"value": [
"travel_insurance",
"car_insurance",
"health_insurance"
]
},
"target_content": {
"type": "modular_content",
"name": "Content",
"value": [
"insurance_landing_page"
]
}
}
},
"modular_content": {
"car_insurance": {
"system": {
"id": "242d3030-e21f-488b-965f-0b170dcb144c",
"name": "Car insurance",
"codename": "car_insurance",
"language": "default",
"type": "page",
"sitemap_locations": [],
"last_modified": "2020-09-02T12:26:18.1255074Z"
},
"elements": {
"title": {
"type": "text",
"name": "Title",
"value": "Car insurance"
},
"url": {
"type": "url_slug",
"name": "URL",
"value": "car-insurance"
},
"show_in_navigation": {
"type": "multiple_choice",
"name": "Show in navigation",
"value": [
{
"name": "Yes",
"codename": "yes"
}
]
},
"navigation_links": {
"type": "modular_content",
"name": "Subpages",
"value": []
},
"target_content": {
"type": "modular_content",
"name": "Content",
"value": []
}
}
},
"health_insurance": {
"system": {
"id": "522624cb-afe3-4f60-b1b0-72a8b1c9ea03",
"name": "Health insurance",
"codename": "health_insurance",
"language": "default",
"type": "page",
"sitemap_locations": [],
"last_modified": "2020-09-02T12:26:37.1424023Z"
},
"elements": {
"title": {
"type": "text",
"name": "Title",
"value": "Health insurance"
},
"url": {
"type": "url_slug",
"name": "URL",
"value": "health-insurance"
},
"show_in_navigation": {
"type": "multiple_choice",
"name": "Show in navigation",
"value": [
{
"name": "Yes",
"codename": "yes"
}
]
},
"navigation_links": {
"type": "modular_content",
"name": "Subpages",
"value": []
},
"target_content": {
"type": "modular_content",
"name": "Content",
"value": []
}
}
},
"insurance_landing_page": {
"system": {
"id": "22f67998-5042-4456-947a-81ba7eed0467",
"name": "Insurance landing page",
"codename": "insurance_landing_page",
"language": "default",
"type": "article",
"sitemap_locations": [],
"last_modified": "2020-09-02T12:28:44.4123144Z"
},
"elements": {
"title": {
"type": "text",
"name": "Title",
"value": "Pick your insurance today!"
},
"body": {
"type": "rich_text",
"name": "Body",
"images": {},
"links": {},
"modular_content": [],
"value": "<p>If you’re thinking about taking out insurance, you’ve probably asked yourself, ‘Why is it so complicated?!” It can be trying to pick a policy that suits your lifestyle, but the search will be worth it if you go about things the right way.</p>"
}
}
},
"travel_insurance": {
"system": {
"id": "4b43567d-c0de-463e-94cc-62b51fe4023f",
"name": "Travel insurance",
"codename": "travel_insurance",
"language": "default",
"type": "page",
"sitemap_locations": [],
"last_modified": "2020-09-02T12:26:01.7874635Z"
},
"elements": {
"title": {
"type": "text",
"name": "Title",
"value": "Travel insurance"
},
"url": {
"type": "url_slug",
"name": "URL",
"value": "travel-insurance"
},
"show_in_navigation": {
"type": "multiple_choice",
"name": "Show in navigation",
"value": [
{
"name": "Yes",
"codename": "yes"
}
]
},
"navigation_links": {
"type": "modular_content",
"name": "Subpages",
"value": []
},
"target_content": {
"type": "modular_content",
"name": "Content",
"value": []
}
}
}
}
}
depth
query parameter to 2 or more.// Tip: Find more about Java SDK at https://kontent.ai/learn/java
import kontent.ai.delivery.*;
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_PROJECT_ID>");
// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Registers the model class for simple articles
client.registerType(SimpleArticle.class);
CompletionStage<SimpleArticle> item = client.getItem(
"the_origin_of_coffee",
SimpleArticle.class,
DeliveryParameterBuilder.params()
.linkedItemsDepth(1)
.build()
);
// Tip: Find more about Java SDK at https://kontent.ai/learn/java
import kontent.ai.delivery.*;
// Initializes a DeliveryClient
DeliveryClient client = new DeliveryClient("<YOUR_PROJECT_ID>");
// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
// Registers the model class for articles
client.registerType(Page.class);
CompletionStage<Page> item = client.getItem(
"insurance_listing",
Page.class,
DeliveryParameterBuilder.params()
.linkedItemsDepth(1)
.build()
);
// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
import java.lang.String;
import java.util.List;
import kontent.ai.delivery.ContentItemMapping;
import kontent.ai.delivery.ElementMapping;
import kontent.ai.delivery.System;
@ContentItemMapping("author")
public class Homepage {
@ElementMapping("name")
String name;
@ElementMapping("bio")
String bio;
System system;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBio() {
return bio;
}
public void setBio(String bio) {
this.bio = bio;
}
public System getSystem() {
return system;
}
public void setSystem(System system) {
this.system = system;
}
}
// Create strongly typed models according to https://kontent.ai/learn/strongly-typed-models
import java.lang.String;
import java.util.List;
import kontent.ai.delivery.ContentItemMapping;
import kontent.ai.delivery.ElementMapping;
import kontent.ai.delivery.System;
@ContentItemMapping("simple_article")
public class Homepage {
@ElementMapping("title")
String title;
@ElementMapping("body")
String body;
@ContentItemMapping("author")
List<ContentItem> author;
System system;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public List<ContentItem> getAuthor() {
return author;
}
public void setAuthor(List<ContentItem> author) {
this.author = author;
}
public System getSystem() {
return system;
}
public void setSystem(System system) {
this.system = system;
}
}