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 Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
delivery_client = Kontent::Ai::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7'
delivery_client.item('the_origin_of_coffee')
.depth(1)
.execute do |response|
item = response.item
puts response.json
end
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
delivery_client = Kontent::Ai::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7'
delivery_client.item('insurance_listing')
.depth(1)
.execute do |response|
item = response.item
puts response.json
end