{"result":{"depiction_url":null,"edges":{"relation":{"objects":[{"created":"2026-10-07T11:13:30Z","object_id":{"id":1576,"is_a":["text","documentation","cookbook"],"name":"doc_cookbook_writing_module","title":{"_type":"trans","tr":{"en":"Create a reusable module"}},"uri":"https:\/\/zotonic.com\/id\/1576"},"seq":1},{"created":"2026-10-07T11:13:30Z","object_id":{"id":1536,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_access_control","title":{"_type":"trans","tr":{"en":"Keep permission checks at the boundary"}},"uri":"https:\/\/zotonic.com\/id\/1536"},"seq":2},{"created":"2026-10-07T11:13:30Z","object_id":{"id":3002,"is_a":["text","documentation","developerguide"],"name":"developer_model_errors","title":{"_type":"trans","tr":{"en":"A model returns an error or no value"}},"uri":"https:\/\/zotonic.com\/id\/3002"},"seq":3}],"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-10-07T11:13:30Z","object_id":{"id":2554,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_how_to_guide","title":"How-to guide","uri":"https:\/\/zotonic.com\/id\/2554"},"seq":1},{"created":"2026-10-07T11:13:30Z","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-10-07T11:13:30Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":3},{"created":"2026-10-07T11:13:30Z","object_id":{"id":2599,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_api_and_integration","title":"API and integration","uri":"https:\/\/zotonic.com\/id\/2599"},"seq":4}],"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":2960,"is_a":["text","documentation","developerguide"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2960"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"developer_model_api","page_url":{"en":"https:\/\/zotonic.com\/docs\/2960\/expose-data-through-a-model","x-default":"https:\/\/zotonic.com\/docs\/2960\/expose-data-through-a-model"},"preview_url":null,"resource":{"body":{"_type":"trans","tr":{"en":"<p>Create <code>src\/models\/m_garden.erl<\/code> in the Garden module. This complete example exposes a public greeting:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">-module(m_garden).\n-behaviour(zotonic_model).\n-export([m_get\/3]).\n\n-spec m_get(Path, Msg, Context) -&gt; Result\n    when\n        Path :: list(),\n        Msg :: zotonic_model:opt_msg(),\n        Context :: z:context(),\n        Result :: zotonic_model:return().\nm_get([&lt;&lt;&quot;greeting&quot;&gt;&gt; | Rest], _Msg, _Context) -&gt;\n    {ok, {&lt;&lt;&quot;Welcome to the garden&quot;&gt;&gt;, Rest}};\nm_get(_Path, _Msg, _Context) -&gt;\n    {error, unknown_path}.\n<\/code><\/pre>\n<p>Compile the application and confirm that Garden is active on the site. Read the value in a template:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">&lt;p&gt;{{ m.garden.greeting|escape }}&lt;\/p&gt;\n<\/code><\/pre>\n<p>Expect the greeting in the rendered page. The callback matches binary path segments and returns the unused path for further lookup. Add explicit permission checks before returning private data, and validate input before an operation changes anything.<\/p>"}},"category_id":{"id":317,"is_a":["meta","category"],"name":"developerguide","title":"Developer guide","uri":"https:\/\/zotonic.com\/id\/developerguide"},"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"},"created":"2026-10-07T11:12:56Z","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"doc_editorial_bundle":true,"doc_editorial_edges":{"relation":[1536,1576,3002],"subject":[2554,2564,2599,2625]},"is_authoritative":true,"is_dependent":false,"is_featured":false,"is_protected":false,"is_published":true,"is_unfindable":false,"language":["en"],"modified":"2026-10-07T11:13:39Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"name":"developer_model_api","pivot_geocode":null,"pivot_location_lat":null,"pivot_location_lng":null,"privacy":0,"publication_end":"9999-06-01T00:00:00Z","publication_start":"2026-10-07T11:12:56Z","slug":"expose-data-through-a-model","summary":{"_type":"trans","tr":{"en":"Create src\/models\/m_garden.erl in the Garden module. This complete example exposes a public greeting:"}},"title":{"_type":"trans","tr":{"en":"Expose data through a model"}},"title_slug":{"_type":"trans","tr":{"en":"expose-data-through-a-model"}},"tz":"UTC","uri":null,"version":18,"visible_for":0},"uri":"https:\/\/zotonic.com\/id\/2960","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2960"}},"status":"ok"}