Example 2 - Text, Embed & Link
Craft personalized content blocks for the display layer of lore
Let's look at an example loreDetails render below - It contains inline bold and italics text, an inline link, paragraph and a youtube embed.
Text, Embed and Links
This lore object is created using the following payload:
// lore details block example
"loreDetails": {
"blocks" : [
{
"id" : "KF-gvSlV7e",
"type" : "paragraph",
"data" : {
"text" : "<b>NFT has been featured! Check it out through this </b><a href=\"http://google.com\">link</a>"
}
},
{
"id":"NyFRY11Sn1",
"type":"embed",
"data":{
"service":"youtube",
"source":"https://www.youtube.com/watch?v=aqz-KE-bpKQ&ab_channel=Blender",
"embed":"https://www.youtube.com/embed/aqz-KE-bpKQ?",
"width":580,
"height":320,
"caption":""
}
},
{
"id" : "A6m0TIMp_S",
"type" : "paragraph",
"data" : {
"text" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <i>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</i>. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat no."
}
}
],
"version" : "2.23.2"
}
Breaking down the payload, you can see the following blocks
Block 1
Block 2
Block 3
// paragraph with inline link and images
{
"id" : "KF-gvSlV7e",
"type" : "paragraph",
"data" : {
"text" : "<b>NFT has been featured! Check it out through this
</b><a href=\"http://google.com\">link</a>"
}
}
// embed with embed URL
{
"id":"NyFRY11Sn1",
"type":"embed",
"data":{
"service":"youtube",
"source":"https://www.youtube.com/watch?v=aqz-KE-bpKQ&ab_channel=Blender",
"embed":"https://www.youtube.com/embed/aqz-KE-bpKQ?",
"width":580,
"height":320,
"caption":""
}
}
}
// paragraph with inline italics
{
"id" : "A6m0TIMp_S",
"type" : "paragraph",
"data" : {
"text" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<i>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat</i>. Duis aute
irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat no."
}
}
Export as PDF
Copy link