<object type="application/kenticocloud" data-type="item" data-codename="my_tweet"></object>
link
parameter to get more information about the linked content items.
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
item_resolver = Kontent::Ai::Delivery::Resolvers::InlineContentItemResolver.new(lambda do |item|
if item.system.type.eql? 'tweet'
return "<blockquote class=\"twitter-tweet\" data-lang=\"en\" data-theme=\"#{item.elements.theme.value[0].codename}\">"\
"<a href=\"#{item.elements.tweet_link.value}\"></a>"\
'</blockquote>'
end
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: '<YOUR_ENVIRONMENT_ID>',
inline_content_item_resolver: item_resolver
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
delivery_client.item('my_article').execute do |response|
item = response.item
text = item.get_string('body')
puts text
end
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
link_resolver = Kontent::Ai::Delivery::Resolvers::ContentLinkResolver.new(lambda do |link|
# Link is available
return "/articles/#{link.url_slug}" if link.type.eql? 'article'
end, lambda do |id|
# Link is broken
return "/notfound?id=#{id}"
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: '<YOUR_ENVIRONMENT_ID>',
content_link_url_resolver: link_resolver
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
delivery_client.item('my_article').execute do |response|
item = response.item
text = item.get_string('body')
puts text
end