{"result":{"depiction_url":null,"edges":{"refers":{"objects":[{"created":"2026-09-09T13:48:27Z","object_id":{"id":1326,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_include","title":"include","uri":"https:\/\/zotonic.com\/id\/1326"},"seq":1000000},{"created":"2026-09-09T13:48:27Z","object_id":{"id":1346,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_block","title":"block","uri":"https:\/\/zotonic.com\/id\/1346"},"seq":1000000},{"created":"2026-09-09T13:48:27Z","object_id":{"id":2505,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_fragment","title":"fragment","uri":"https:\/\/zotonic.com\/id\/2505"},"seq":1000000},{"created":"2026-09-09T13:48:27Z","object_id":{"id":2506,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_compose","title":"compose","uri":"https:\/\/zotonic.com\/id\/2506"},"seq":1000000},{"created":"2026-09-09T13:48:27Z","object_id":{"id":2507,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_use","title":"use","uri":"https:\/\/zotonic.com\/id\/2507"},"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-09-09T13:48:27Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:48:27Z","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-09-09T13:48:27Z","object_id":{"id":2620,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_template","title":"Template","uri":"https:\/\/zotonic.com\/id\/2620"},"seq":3},{"created":"2026-09-09T13:48:27Z","object_id":{"id":2641,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_render","title":"Render","uri":"https:\/\/zotonic.com\/id\/2641"},"seq":4},{"created":"2026-09-09T13:48:27Z","object_id":{"id":2691,"is_a":["categorization","keyword","keyword_quality"],"name":"zotonic_topic_maintainability","title":"Maintainability","uri":"https:\/\/zotonic.com\/id\/2691"},"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":2509,"is_a":["text","documentation","reference","template_tag"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2509"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_template_tag_tag_useblock","page_url":{"en":"https:\/\/zotonic.com\/docs\/2509\/useblock","x-default":"https:\/\/zotonic.com\/docs\/2509\/useblock"},"preview_url":null,"resource":{"version":51,"pivot_location_lat":null,"title":"useblock","is_authoritative":true,"body":"<aside><p>See also<\/p><p><a href=\"\/id\/doc_template_tag_tag_fragment\" class=\"doc-reference doc-reference-tag\"><code>tag#fragment<\/code><\/a> and <a href=\"\/id\/doc_template_tag_tag_use\" class=\"doc-reference doc-reference-tag\"><code>tag#use<\/code><\/a>.<\/p><\/aside>\n<p>Render a named <a href=\"\/id\/doc_template_tag_tag_fragment\" class=\"doc-reference doc-reference-tag\"><code>tag#fragment<\/code><\/a>, pass it enclosed body content, and optionally override its named blocks.<\/p>\n<p>The <code>useblock<\/code> tag is like <a href=\"\/id\/doc_template_tag_tag_use\" class=\"doc-reference doc-reference-tag\"><code>tag#use<\/code><\/a>, but also passes the enclosed rendered content to the fragment in the special variable <code>_body<\/code>.<\/p>\n<p>If the fragment contains named <a href=\"\/id\/doc_template_tag_tag_block\" class=\"doc-reference doc-reference-tag\"><code>tag#block<\/code><\/a> definitions, then the <code>useblock<\/code> body can also define blocks with the same names. Those caller blocks override the fragment’s block definitions, similar to <a href=\"\/id\/doc_template_tag_tag_compose\" class=\"doc-reference doc-reference-tag\"><code>tag#compose<\/code><\/a>.<\/p>\n<p>Example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% fragment panel %}\n    &lt;section class=&quot;panel&quot;&gt;\n        &lt;h2&gt;{{ title }}&lt;\/h2&gt;\n        &lt;div class=&quot;panel-body&quot;&gt;{{ _body }}&lt;\/div&gt;\n    &lt;\/section&gt;\n{% endfragment %}\n\n{% useblock panel title=&quot;Summary&quot; %}\n    &lt;p&gt;Hello world&lt;\/p&gt;\n{% enduseblock %}\n<\/code><\/pre>\n<p>Example with block overrides:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% fragment panel %}\n    &lt;section&gt;\n        {% block title %}Default title{% endblock %}\n        &lt;div&gt;{{ _body }}&lt;\/div&gt;\n    &lt;\/section&gt;\n{% endfragment %}\n\n{% useblock panel %}\n    {% block title %}Custom title{% endblock %}\n    Body text\n{% enduseblock %}\n<\/code><\/pre>\n<div class=\"admonition note\"><p class=\"first admonition-title\">Note<\/p><p>Like the <a href=\"\/id\/doc_template_tag_tag_include\" class=\"doc-reference doc-reference-tag\"><code>tag#include<\/code><\/a> tag, the <code>with<\/code> keyword is optional:<\/p><pre class=\"notranslate last\"><code class=\"notranslate language-django\">{% useblock panel title=&quot;Summary&quot; %}\n    &lt;p&gt;Hello world&lt;\/p&gt;\n{% enduseblock %}\n\n{% useblock panel with title=&quot;Summary&quot; %}\n    &lt;p&gt;Hello world&lt;\/p&gt;\n{% enduseblock %}\n<\/code><\/pre><\/div>","slug":"useblock","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"069d5bcd098df98bf108b2500888febb8deb9525570e426dc3ccf670612b9241","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":324,"is_a":["meta","category"],"name":"template_tag","title":"Tags","uri":"https:\/\/test.zotonic.com\/id\/324"},"doc_source_path":"doc\/template-tags\/useblock.md","publication_start":"2026-03-27T13:48:02Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/doc\/template-tags\/useblock.md","pivot_location_lng":null,"doc_source_kind":"template_tag","name":"doc_template_tag_tag_useblock","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2026-03-27T13:48:02Z","uri":null,"doc_status":"current","is_dependent":false,"publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"66cb145eae7002b184e7d8c4c7bba5e53e8248e5\n","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-10-02T12:40:48Z","title_slug":"useblock"},"uri":"https:\/\/zotonic.com\/id\/2509","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2509"}},"status":"ok"}