{"id":47023,"date":"2017-03-15T11:13:44","date_gmt":"2017-03-15T05:43:44","guid":{"rendered":"https:\/\/tothenewco.pro\/blog\/?p=47023"},"modified":"2017-03-15T11:13:44","modified_gmt":"2017-03-15T05:43:44","slug":"how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8","status":"publish","type":"post","link":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/","title":{"rendered":"How to Programmatically Replace the Content in the Custom Block in Drupal 8?"},"content":{"rendered":"<p>Replacing the content in the custom block is often challenging.\u00a0In <a title=\"Drupal 8 Development Services\" href=\"https:\/\/tothenewco.pro\/wcm\/drupal-development-consulting-services\">Drupal 8<\/a>, the best way to replace the content in the custom block programmatically is to use module_preprocess_block alter.<\/p>\n<p>We have created a custom block and now we want to replace the value of the placeholder programmatically. For eg. On http:\/\/example.com\/, we have created a custom block named &#8220;Test Block&#8221; for the home page. The body of the\u00a0custom block contains the following code:<\/p>\n<p>[java]<\/p>\n<p>&lt;div&gt;<br \/>\n&lt;div class=&quot;\u201ccontent\u201d&quot;&gt;<br \/>\n&lt;h5&gt;&lt;a href=&quot;\u201c{{link}}\u201d&quot;&gt;Test Block&lt;\/a&gt;&lt;\/h5&gt;  \/\/ {{link}} represents the placeholder<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>[\/java]<\/p>\n<p>Now we want to replace the value of placeholder ({{link}}) with a node page URL link programmatically. Here&#8217;s how to go about it:<\/p>\n<p>Create an alter module by following the below steps:<\/p>\n<p>Step 1- Create a test folder in the modules folder<br \/>\nStep 2- Create &#8220;test.info.yml&#8221; file that will have entire information about module such as name, type, package, version.<\/p>\n<p>[java]<br \/>\nname: Test Block<br \/>\ndescription: &#8216;Module to replace the placeholder.&#8217;<br \/>\npackage: Custom<br \/>\ntype: module<br \/>\ncore: 8.x<br \/>\n[\/java]<\/p>\n<p>Step 3- Create &#8220;test.routing.yml&#8221; file and add routing for this module<br \/>\nStep 4- Create &#8220;test.module&#8221; file which will contain the preprocess alter of the custom block. The custom block contains the placeholder<br \/>\nStep 5- Open the test.module file and add preprocess alter code as shown below:<\/p>\n<p>[java]<br \/>\n use Drupal\\Core\\Block\\BlockBase;<br \/>\n use Drupal\\node\\Entity\\Node;<br \/>\n use Drupal\\Core\\Url;<br \/>\n use Drupal\\file\\Entity\\File;<br \/>\n use Drupal\\field\\Entity\\FieldConfig;<\/p>\n<p> \/**<br \/>\n * function preprocess block for Test block<br \/>\n *\/<br \/>\n function test_preprocess_block(&amp;$variables)<br \/>\n {<\/p>\n<p> if (isset($variables[&#8216;content&#8217;][&#8216;#block_content&#8217;]))<\/p>\n<p> {<br \/>\n $content = $variables[&#8216;content&#8217;][&#8216;#block_content&#8217;];<br \/>\n if( method_exists($content,&#8217;id&#8217;) &amp;&amp; $content-&gt;id() == &#8216;block_id&#8217;)<br \/>\n\/*<br \/>\n* Block Id represents id of coressponding block which contains the placeholder.<br \/>\n*\/<br \/>\n {<br \/>\n $body = $variables[&#8216;content&#8217;][&#8216;body&#8217;][0][&#8216;#text&#8217;];<br \/>\n \/*<br \/>\n * now you need to replace with placeholder by finding the dynamic link<br \/>\n *\/<br \/>\n $query = \\Drupal::entityQuery(&#8216;node&#8217;);<br \/>\n $query-&gt;range(0, 1);<br \/>\n $result = $query-&gt;execute();<br \/>\n $nids = array_values($result);<br \/>\n if (isset($nids[0]))<br \/>\n {<br \/>\n $node_load = Node::load($nids[0]);<br \/>\n $options = array(&#8216;absolute&#8217;=&gt;TRUE);<br \/>\n $url = Url::fromRoute(&#8216;entity.node.canonical&#8217;, [ &#8216;node&#8217;=&gt;$nids[0] ], $options);<br \/>\n $Url = $url-&gt;toString();<br \/>\n $body=str_replace(&#8216;{{link}}&#8217;,$Url,$body);<br \/>\n $variables[&#8216;content&#8217;][&#8216;body&#8217;][0][&#8216;#text&#8217;] = $body;<br \/>\n }<br \/>\n }<br \/>\n }<br \/>\n }<br \/>\n[\/java]<\/p>\n<p>The Block Id and the placeholder are highlighted in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47029\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/screenshot3-1024x575.png\" alt=\"screenshot(3)\" width=\"625\" height=\"350\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2017\/03\/screenshot3-1024x575.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2017\/03\/screenshot3-300x168.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2017\/03\/screenshot3-624x350.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2017\/03\/screenshot3.png 1366w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>We hope you will able to now replace the content in your custom block easily following the above steps. In case if you have more queries about Drupal 8 custom blocks, feel free to share them in the comments below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Replacing the content in the custom block is often challenging.\u00a0In Drupal 8, the best way to replace the content in the custom block programmatically is to use module_preprocess_block alter. We have created a custom block and now we want to replace the value of the placeholder programmatically. For eg. On http:\/\/example.com\/, we have created a [&hellip;]<\/p>\n","protected":false},"author":1077,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":156,"footnotes":""},"categories":[3602,1],"tags":[4496,4490,3601,4495,4489],"class_list":["post-47023","post","type-post","status-publish","format-standard","hentry","category-drupal","category-technology","tag-content-management-2","tag-custom-drupal-development","tag-drupal-8","tag-drupal-cms","tag-drupal-development"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Aayushi Garg\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#article\",\"name\":\"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog\",\"headline\":\"How to Programmatically Replace the Content in the Custom Block in Drupal 8?\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/aayushi-garg\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2017\\\/03\\\/screenshot3-1024x575.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#articleImage\"},\"datePublished\":\"2017-03-15T11:13:44+05:30\",\"dateModified\":\"2017-03-15T11:13:44+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#webpage\"},\"articleSection\":\"Drupal, Technology, Content management, Custom Drupal Development, Drupal 8, drupal CMS, Drupal Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#listItem\",\"name\":\"How to Programmatically Replace the Content in the Custom Block in Drupal 8?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#listItem\",\"position\":3,\"name\":\"How to Programmatically Replace the Content in the Custom Block in Drupal 8?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/aayushi-garg\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/aayushi-garg\\\/\",\"name\":\"Aayushi Garg\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/42145690-f4c2-4f4c-b9e7-30b17731eaf4_147-Aayushi-Garg-PROFILEPICTURE.jpg\",\"width\":96,\"height\":96,\"caption\":\"Aayushi Garg\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/\",\"name\":\"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog\",\"description\":\"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/aayushi-garg\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/aayushi-garg\\\/#author\"},\"datePublished\":\"2017-03-15T11:13:44+05:30\",\"dateModified\":\"2017-03-15T11:13:44+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog","description":"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.","canonical_url":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#article","name":"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog","headline":"How to Programmatically Replace the Content in the Custom Block in Drupal 8?","author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/aayushi-garg\/#author"},"publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/screenshot3-1024x575.png","@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#articleImage"},"datePublished":"2017-03-15T11:13:44+05:30","dateModified":"2017-03-15T11:13:44+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#webpage"},"isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#webpage"},"articleSection":"Drupal, Technology, Content management, Custom Drupal Development, Drupal 8, drupal CMS, Drupal Development"},{"@type":"BreadcrumbList","@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/tothenewco.pro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/tothenewco.pro\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#listItem","name":"How to Programmatically Replace the Content in the Custom Block in Drupal 8?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#listItem","position":3,"name":"How to Programmatically Replace the Content in the Custom Block in Drupal 8?","previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/tothenewco.pro\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/tothenewco.pro\/blog\/"},{"@type":"Person","@id":"https:\/\/tothenewco.pro\/blog\/author\/aayushi-garg\/#author","url":"https:\/\/tothenewco.pro\/blog\/author\/aayushi-garg\/","name":"Aayushi Garg","image":{"@type":"ImageObject","@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/42145690-f4c2-4f4c-b9e7-30b17731eaf4_147-Aayushi-Garg-PROFILEPICTURE.jpg","width":96,"height":96,"caption":"Aayushi Garg"}},{"@type":"WebPage","@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#webpage","url":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/","name":"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog","description":"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/#breadcrumblist"},"author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/aayushi-garg\/#author"},"creator":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/aayushi-garg\/#author"},"datePublished":"2017-03-15T11:13:44+05:30","dateModified":"2017-03-15T11:13:44+05:30"},{"@type":"WebSite","@id":"https:\/\/tothenewco.pro\/blog\/#website","url":"https:\/\/tothenewco.pro\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog","og:description":"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.","og:url":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/","og:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | TO THE NEW Blog","twitter:description":"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.","twitter:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"47023","title":"How to Programmatically Replace the Content in the Custom Block in Drupal 8? | #site_title","description":"In this blog, we will walk you through the ways to replace the content programmatically in the custom block in Drupal 8.","keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 12:29:07","updated":"2024-02-29 08:38:30","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Programmatically Replace the Content in the Custom Block in Drupal 8?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/tothenewco.pro\/blog"},{"label":"Technology","link":"https:\/\/tothenewco.pro\/blog\/category\/technology\/"},{"label":"How to Programmatically Replace the Content in the Custom Block in Drupal 8?","link":"https:\/\/tothenewco.pro\/blog\/how-to-programmatically-replace-the-content-in-the-custom-block-in-drupal-8\/"}],"_links":{"self":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/47023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/users\/1077"}],"replies":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/comments?post=47023"}],"version-history":[{"count":0,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/47023\/revisions"}],"wp:attachment":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/media?parent=47023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/categories?post=47023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/tags?post=47023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}