{"result":{"depiction_url":null,"edges":{"references":{"objects":[{"created":"2020-05-30T05:48:00Z","object_id":{"id":1352,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_templates","title":{"_type":"trans","tr":{"en":"Create a page layout"}},"uri":"https:\/\/zotonic.com\/id\/1352"},"seq":1000000},{"created":"2020-05-30T05:48:00Z","object_id":{"id":2101,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_req","title":"req","uri":"https:\/\/zotonic.com\/id\/2101"},"seq":1000000},{"created":"2020-05-30T05:48:00Z","object_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"seq":1000000},{"created":"2020-05-30T05:48:00Z","object_id":{"id":1278,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_rsc","title":"rsc","uri":"https:\/\/zotonic.com\/id\/1278"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}}},"id":1840,"is_a":["text","documentation","reference"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1840"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_reference_global_variables","page_url":{"en":"https:\/\/zotonic.com\/reference\/template-variables","x-default":"https:\/\/zotonic.com\/reference\/template-variables"},"preview_url":null,"resource":{"version":3278,"pivot_location_lat":null,"title":"Global template variables","is_authoritative":true,"body":"<div>\n            \n  <div class=\"section\">\n\n<p>These variables are always available for\n<a class=\"reference internal\" href=\"\/id\/doc_developerguide_templates#template-variables\"><span class=\"std std-ref\">rendering in templates<\/span><\/a>.<\/p>\n<div class=\"section\">\n<h2>zotonic_version<\/h2>\n<p>The version of Zotonic, for example <code class=\"docutils literal notranslate\"><span class=\"pre\">&quot;1.0-dev&quot;<\/span><\/code>.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>zotonic_dispatch<\/h2>\n<p>An atom with the name of the dispatch rule that was applied to render the current page.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>zotonic_dispatch_path<\/h2>\n<p>A list containing the request path used as initial input for the dispatcher.\nThe path is split on <code class=\"docutils literal notranslate\"><span class=\"pre\">\/<\/span><\/code> and after an optional rewrite. This means that the\nlist doesn’t contain the language prefix. For example, the path\n<code class=\"docutils literal notranslate\"><span class=\"pre\">\/en\/foo\/bar?a=b<\/span><\/code> will give the list <code class=\"docutils literal notranslate\"><span class=\"pre\">[&lt;&lt;&quot;foo&quot;&gt;&gt;,<\/span> <span class=\"pre\">&lt;&lt;&quot;bar&quot;&gt;&gt;]<\/span><\/code>.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>zotonic_dispatch_path_rewrite<\/h2>\n<p>Same as zotonic_dispatch_path, but set to the path after an optional internal\nrequest rewrite inside the dispatcher. For example if a resource has its\n<cite>page_path<\/cite> set to <code class=\"docutils literal notranslate\"><span class=\"pre\">\/foo<\/span><\/code> and the requested path is <code class=\"docutils literal notranslate\"><span class=\"pre\">\/en\/foo<\/span><\/code> then the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic_dispatch_path<\/span><\/code> will be set to <code class=\"docutils literal notranslate\"><span class=\"pre\">[&lt;&lt;&quot;foo&quot;&gt;&gt;]<\/span><\/code> and the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic_dispatch_path_rewrite<\/span><\/code> could be set to something like\n<code class=\"docutils literal notranslate\"><span class=\"pre\">[&lt;&lt;&quot;page&quot;&gt;&gt;,<\/span> <span class=\"pre\">&lt;&lt;&quot;1234&quot;&gt;&gt;,<\/span> <span class=\"pre\">&lt;&lt;&quot;foo-slug&quot;&gt;&gt;]<\/span><\/code>.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>z_language<\/h2>\n<p>The currently selected language. This an atom, for example: <code class=\"docutils literal notranslate\"><span class=\"pre\">en<\/span><\/code>.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>q<\/h2>\n<p>A key\/value list containing the current request’s query variables. For GET requests, these are the arguments passed from the query string (e.g. <code class=\"docutils literal notranslate\"><span class=\"pre\">?foo=bar<\/span><\/code>); for POST requests, these are also the values posted in the POST form. For more access to the raw request data, look at the <a class=\"reference internal\" href=\"\/id\/doc_model_model_req\"><span class=\"std std-ref\">m_req<\/span><\/a> model.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>now<\/h2>\n<p>The UTC date and time in Erlang tuple notation, for instance <code class=\"docutils literal notranslate\"><span class=\"pre\">{{2014,4,17},{13,50,2}}<\/span><\/code>.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>m<\/h2>\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">m<\/span><\/code> is not really a value, but it’s an indicator to trigger a lookup in one of Zotonic’s <a class=\"reference internal\" href=\"\/id\/model#models\"><span class=\"std std-ref\">Models<\/span><\/a>. For instance the <a class=\"reference internal\" href=\"\/id\/doc_model_model_rsc\"><span class=\"std std-ref\">m_rsc<\/span><\/a> model is always exposed and can be used like this <code class=\"docutils literal notranslate\"><span class=\"pre\">{{<\/span> <span class=\"pre\">m.rsc[123].title<\/span> <span class=\"pre\">}}<\/span><\/code>.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>true, false, and undefined<\/h2>\n<p>The values <code class=\"docutils literal notranslate\"><span class=\"pre\">true<\/span><\/code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">false<\/span><\/code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">undefined<\/span><\/code> are predefined.<\/p>\n<\/div>\n<\/div>\n\n\n           <\/div>","slug":"global-template-variables","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":319,"is_a":["meta","category"],"name":"reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/reference"},"publication_start":"2023-01-30T19:23:59Z","is_website_redirect":false,"page_path":"\/reference\/template-variables","github_url":"https:\/\/github.com\/zotonic\/zotonic\/tree\/master\/doc\/ref\/global-variables.rst","pivot_location_lng":null,"name":"doc_reference_global_variables","is_unfindable":false,"is_published":true,"pivot_geocode":null,"custom_slug":false,"created":"2020-05-30T05:47:39Z","uri":null,"is_dependent":false,"is_page_path_multiple":false,"publication_end":"9999-08-17T12:00:00Z","modifier_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"privacy":0,"creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"seo_noindex":false,"modified":"2023-01-30T19:23:59Z","title_slug":"global-template-variables"},"uri":"https:\/\/zotonic.com\/id\/1840","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1840"}},"status":"ok"}