{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-05-30T05:47:51Z","object_id":{"id":1296,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_base","title":"mod_base","uri":"https:\/\/zotonic.com\/id\/1296"},"seq":1000000}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"references":{"objects":[{"created":"2020-05-30T05:47:51Z","object_id":{"id":1325,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_catinclude","title":"catinclude","uri":"https:\/\/zotonic.com\/id\/1325"},"seq":1000000},{"created":"2020-05-30T05:47:51Z","object_id":{"id":1536,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_access_control","title":"Access control","uri":"https:\/\/zotonic.com\/id\/1536"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-09-09T13:47:53Z","object_id":{"id":1325,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_catinclude","title":"catinclude","uri":"https:\/\/zotonic.com\/id\/1325"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"relation":{"objects":[{"created":"2020-05-30T05:47:51Z","object_id":{"id":1534,"is_a":["text","documentation","reference","controller"],"name":"doc_controller_controller_page","title":"controller_page","uri":"https:\/\/zotonic.com\/id\/1534"},"seq":1000000}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-09-09T13:47:53Z","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:47:53Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-09-09T13:47:53Z","object_id":{"id":2608,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_routing_and_redirects","title":"Routing and redirects","uri":"https:\/\/zotonic.com\/id\/2608"},"seq":3},{"created":"2026-09-09T13:47:53Z","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-09-09T13:47:53Z","object_id":{"id":2626,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_controller","title":"Controller","uri":"https:\/\/zotonic.com\/id\/2626"},"seq":5},{"created":"2026-09-09T13:47:53Z","object_id":{"id":2641,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_render","title":"Render","uri":"https:\/\/zotonic.com\/id\/2641"},"seq":6},{"created":"2026-09-09T13:47:53Z","object_id":{"id":2672,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_html","title":"HTML","uri":"https:\/\/zotonic.com\/id\/2672"},"seq":7}],"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":1537,"is_a":["text","documentation","reference","controller"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1537"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_controller_controller_template","page_url":{"en":"https:\/\/zotonic.com\/docs\/1537\/controller_template","x-default":"https:\/\/zotonic.com\/docs\/1537\/controller_template"},"preview_url":null,"resource":{"version":3325,"pivot_location_lat":null,"title":"controller_template","is_authoritative":true,"body":"<p>Show a template.<\/p>\n<p>This controller renders the template configured in the dispatch rules.<\/p>\n<p>Example dispatch rule:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{home, [], controller_template, [{template, &quot;home.tpl&quot;}]}\n<\/code><\/pre>\n<p>This will render the <code>home.tpl<\/code> template at the url <code>\/<\/code>.<\/p>\n<h2>Dispatch arguments<\/h2>\n<p><code>controller_template<\/code> recognizes the following arguments inside the dispatch pattern:<\/p>\n<table class=\"table\"><thead><tr><th>Argument<\/th><th>Description<\/th><th>Example URL<\/th><\/tr><\/thead><tbody><tr><td><code>id<\/code><\/td><td>A resource id to be used in the template. This can be the numerical id or the unique name of a page. More commonly the id is given as a dispatch option.<\/td><td><code>\/page\/12345<\/code><\/td><\/tr><\/tbody><\/table>\n<h2>Dispatch options<\/h2>\n<p>The following options can be given to the dispatch rule:<\/p>\n<table class=\"table\"><thead><tr><th>Option<\/th><th>Description<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td><code>template<\/code><\/td><td>Name of the template to be rendered. Can also be a tuple of the following form: <code>{cat, Name}<\/code>. See also: <a href=\"\/id\/doc_template_tag_tag_catinclude\" class=\"doc-reference doc-reference-tag\"><code>tag#catinclude<\/code><\/a>.<\/td><td><code>{template, &quot;home.tpl&quot;}<\/code> <code>{template, {cat, &quot;home.tpl&quot;}}<\/code><\/td><\/tr><tr><td><code>anonymous<\/code><\/td><td>Render the template always as the anonymous user, even when a user is logged on. Defaults to false.<\/td><td><code>{anonymous, true}<\/code><\/td><\/tr><tr><td><code>content_type<\/code><\/td><td>The content type provided by the dispatch rule. Defaults to <code>&quot;text\/html&quot;<\/code>.<\/td><td><code>{content_type, &quot;application\/json&quot;}<\/code><\/td><\/tr><tr><td><code>max_age<\/code><\/td><td>The number of seconds of how long to cache this file in the browser. Sets the response header <code>Cache-Control: public; max-age=X<\/code>.<\/td><td><code>{max_age, 3600}<\/code><\/td><\/tr><tr><td><code>acl_action<\/code><\/td><td>What ACL action will be checked. Defaults to <code>view<\/code>; but can also be <code>edit<\/code> if users need edit permission on the rsc to be able to access the resource.<\/td><td><code>{acl_action, edit}<\/code><\/td><\/tr><tr><td><code>acl<\/code><\/td><td>Extra authorization checks to be performed.<\/td><td>See <a href=\"#acl-options\">ACL options<\/a>.<\/td><\/tr><tr><td><code>id<\/code><\/td><td>Id or unique name of a resource to be referenced in the rendered template. This overrules an id from the query arguments.<\/td><td><code>{id, page_about}<\/code><\/td><\/tr><tr><td><code>seo_noindex<\/code><\/td><td>Ask crawlers to not index this page.<\/td><td><code>seo_noindex<\/code><\/td><\/tr><tr><td><code>nocache<\/code><\/td><td>Prevent browser caching this page.<\/td><td><code>nocache<\/code><\/td><\/tr><tr><td><code>http_status<\/code><\/td><td>The HTTP status code to return. This defaults to <code>200<\/code>.<\/td><td><code>{http_status, 418}<\/code><\/td><\/tr><\/tbody><\/table>\n<h2>ACL options<\/h2>\n<p><a href=\"\/id\/doc_developerguide_access_control#guide-authorization\">Authorization<\/a> checks to perform, in addition to the <code>acl_action<\/code> dispatch option, can be given in the <code>acl<\/code> dispatch option, and accepts the following options:<\/p>\n<table class=\"table\"><thead><tr><th>ACL option<\/th><th>Description<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td><code>is_auth<\/code><\/td><td>Disable anonymous access to this resource.<\/td><td><code>{acl, is_auth}<\/code><\/td><\/tr><tr><td><code>logoff<\/code><\/td><td>Log out user before processing the request.<\/td><td><code>{acl, logoff}<\/code><\/td><\/tr><tr><td><code>{Action, Resource}<\/code><\/td><td>Check if user is allowed to perform <code>Action<\/code> on <code>Resource<\/code>. The example is equivalent to the options <code>{acl_action, edit}, {id, my_named_page}<\/code>.<\/td><td><code>{acl, {edit, my_named_page}}<\/code><\/td><\/tr><tr><td><code>[{Action, Resource}]<\/code><\/td><td>A list of checks to be performed, as above.<\/td><td><code>{acl, [{view, secret_page}, {update, 345}]}<\/code><\/td><\/tr><tr><td><code>ignore<\/code><\/td><td>Don’t perform any access control checks. Be careful to add your own checks in the rendered template and all its included templates.<\/td><td><code>{acl, ignore}<\/code><\/td><\/tr><\/tbody><\/table>","slug":"controller_template","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"ab4b68a4a7f4341a4c75ad60f8b05c45cb3dd3837dc6feeb02afdc10f410b6e9","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":321,"is_a":["meta","category"],"name":"controller","title":"Controllers","uri":"https:\/\/test.zotonic.com\/id\/321"},"doc_source_path":"apps\/zotonic_mod_base\/src\/controllers\/controller_template.erl","publication_start":"2023-01-30T19:23:58Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_base\/src\/controllers\/controller_template.erl","pivot_location_lng":null,"doc_source_kind":"controller","name":"doc_controller_controller_template","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:25Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_base","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":"b8c4b2ccdc223257f311968fbd17b2d66f0c4156\n","erlang_module":"controller_template","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-09-30T09:39:41Z","title_slug":"controller_template"},"uri":"https:\/\/zotonic.com\/id\/1537","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1537"}},"status":"ok"}