{"result":{"depiction_url":null,"edges":{"hasreference":{"objects":[{"created":"2026-10-07T11:13:40Z","object_id":{"id":1274,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_notifications","title":{"_type":"trans","tr":{"en":"Respond to a notification"}},"uri":"https:\/\/zotonic.com\/id\/1274"},"seq":1},{"created":"2026-10-07T11:13:40Z","object_id":{"id":2807,"is_a":["text","documentation","userguide"],"name":"editor_content_blocks","title":{"_type":"trans","tr":{"en":"Adding content blocks"}},"uri":"https:\/\/zotonic.com\/id\/2807"},"seq":2}],"predicate":{"id":2774,"is_a":["meta","predicate"],"name":"hasreference","title":{"_type":"trans","tr":{"en":"Documentation reference"}},"uri":"https:\/\/zotonic.com\/id\/hasreference"}},"refers":{"objects":[{"created":"2026-10-07T11:13:02Z","object_id":{"id":2072,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_admin_blocks","title":"admin_blocks","uri":"https:\/\/zotonic.com\/id\/2072"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"subject":{"objects":[{"created":"2026-10-07T11:13:40Z","object_id":{"id":2557,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_cookbook_recipe","title":"Cookbook recipe","uri":"https:\/\/zotonic.com\/id\/2557"},"seq":1},{"created":"2026-10-07T11:13:40Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-10-07T11:13:40Z","object_id":{"id":2568,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_content_modeling","title":"Content modeling","uri":"https:\/\/zotonic.com\/id\/2568"},"seq":3},{"created":"2026-10-07T11:13:40Z","object_id":{"id":2620,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_template","title":"Template","uri":"https:\/\/zotonic.com\/id\/2620"},"seq":4},{"created":"2026-10-07T11:13:40Z","object_id":{"id":2570,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_content_authoring","title":"Content authoring","uri":"https:\/\/zotonic.com\/id\/2570"},"seq":5}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":1583,"is_a":["text","documentation","cookbook"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1583"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_cookbook_frontend_custom_content_block","page_url":{"en":"https:\/\/zotonic.com\/cookbook\/1583\/add-a-custom-content-block","x-default":"https:\/\/zotonic.com\/cookbook\/1583\/add-a-custom-content-block"},"preview_url":null,"resource":{"version":39,"pivot_location_lat":null,"title":{"_type":"trans","tr":{"en":"Add a custom content block"}},"is_authoritative":true,"body":{"_type":"trans","tr":{"en":"<p>The block menu comes from <a href=\"\/id\/2072\" class=\"doc-reference doc-reference-model\"><code>model#admin_blocks<\/code><\/a>. Register a callout type through its <code>admin_edit_blocks<\/code> notification. In the active site or module Erlang file, export <code>observe_admin_edit_blocks\/3<\/code> and include <code>zotonic.hrl<\/code>:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">observe_admin_edit_blocks(_Event, Blocks, _Context) -&gt;\n    [{100, &lt;&lt;&quot;Garden&quot;&gt;&gt;, [{callout, &lt;&lt;&quot;Callout&quot;&gt;&gt;}]} | Blocks].\n<\/code><\/pre>\n<p>Create <code>priv\/templates\/blocks\/_admin_edit_block_li_callout.tpl<\/code>:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">&lt;label for=&quot;{{ #text }}&quot;&gt;{_ Callout text _}&lt;\/label&gt;\n&lt;textarea id=&quot;{{ #text }}&quot; name=&quot;blocks[].text&quot;\n          class=&quot;form-control&quot;&gt;{{ blk.text|escape }}&lt;\/textarea&gt;\n<\/code><\/pre>\n<p>Create <code>priv\/templates\/blocks\/_block_view_callout.tpl<\/code>:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">&lt;aside class=&quot;callout&quot;&gt;{{ blk.text|escape }}&lt;\/aside&gt;\n<\/code><\/pre>\n<p>Use the site&#39;s existing page-block rendering loop (<code>{% include &quot;_blocks.tpl&quot; %}<\/code> in the standard layout). Compile, refresh observer registration, then add a callout in admin, save, reopen and view the public page. Confirm the text survives saving and markup entered in the field remains plain text.<\/p>\n<p>Use <code>blocks[].field<\/code> names; old hyphenated field examples do not describe the current form parser. Embedded services need a separate URL\/provider policy, consent and CSP review; do not turn this into a field for arbitrary iframe HTML.<\/p>"}},"is_mailing_opt_out":false,"slug":"add-a-custom-content-block","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"is_featured":false,"content_group_id":{"id":339,"is_a":["meta","content_group"],"name":"default_content_group","title":{"_type":"trans","tr":{"en":"Default Content Group"}},"uri":"https:\/\/zotonic.com\/id\/default_content_group"},"category_id":{"id":318,"is_a":["meta","category"],"name":"cookbook","title":{"_type":"trans","tr":{"en":"Cookbook"}},"uri":"https:\/\/test.zotonic.com\/id\/318"},"publication_start":"2022-02-15T10:01:00Z","is_website_redirect":false,"github_url":"https:\/\/github.com\/zotonic\/zotonic\/tree\/master\/doc\/cookbook\/frontend-custom-content-block.rst","pivot_location_lng":null,"name":"doc_cookbook_frontend_custom_content_block","is_unfindable":false,"is_published":true,"doc_editorial_edges":{"hasreference":[1274,2807],"subject":[2557,2563,2568,2570,2620]},"summary":{"_type":"trans","tr":{"en":"Add a plain-text callout block using current admin field names."}},"pivot_geocode":null,"custom_slug":false,"created":"2020-05-30T05:47:27Z","uri":null,"date_is_all_day":false,"is_dependent":false,"is_page_path_multiple":false,"translation_status":{"en":""},"publication_end":"9999-08-17T12:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_editorial_bundle":true,"creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"seo_noindex":false,"modified":"2026-10-07T11:13:50Z","title_slug":{"_type":"trans","tr":{"en":"add-a-custom-content-block"}}},"uri":"https:\/\/zotonic.com\/id\/1583","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1583"}},"status":"ok"}