{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-05-30T05:47:55Z","object_id":{"id":1288,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_menu","title":"mod_menu","uri":"https:\/\/zotonic.com\/id\/1288"},"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:55Z","object_id":{"id":1364,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_if","title":"if","uri":"https:\/\/zotonic.com\/id\/1364"},"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:59Z","object_id":{"id":1364,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_if","title":"if","uri":"https:\/\/zotonic.com\/id\/1364"},"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:55Z","object_id":{"id":1626,"is_a":["text","documentation","reference","template_filter"],"name":"doc_template_filter_filter_menu_subtree","title":"menu_subtree","uri":"https:\/\/zotonic.com\/id\/1626"},"seq":1000000},{"created":"2020-05-30T05:47:55Z","object_id":{"id":1625,"is_a":["text","documentation","reference","template_filter"],"name":"doc_template_filter_filter_menu_flat","title":"menu_flat","uri":"https:\/\/zotonic.com\/id\/1625"},"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:59Z","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:59Z","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:47:59Z","object_id":{"id":2575,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_navigation","title":"Navigation","uri":"https:\/\/zotonic.com\/id\/2575"},"seq":3},{"created":"2026-09-09T13:47:59Z","object_id":{"id":2621,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_template_filter","title":"Template filter","uri":"https:\/\/zotonic.com\/id\/2621"},"seq":4},{"created":"2026-09-09T13:47:59Z","object_id":{"id":2643,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_query","title":"Query","uri":"https:\/\/zotonic.com\/id\/2643"},"seq":5},{"created":"2026-09-09T13:47:59Z","object_id":{"id":2664,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_collection","title":"Collection","uri":"https:\/\/zotonic.com\/id\/2664"},"seq":6}],"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":1627,"is_a":["text","documentation","reference","template_filter"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1627"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_template_filter_filter_menu_trail","page_url":{"en":"https:\/\/zotonic.com\/docs\/1627\/menu_trail","x-default":"https:\/\/zotonic.com\/docs\/1627\/menu_trail"},"preview_url":null,"resource":{"version":3987,"pivot_location_lat":null,"title":"menu_trail","is_authoritative":true,"body":"<p>Return a breadcrumb navigation trail for the given id.<\/p>\n<p>This filter locates the filter value which represents the current page in the main menu or in the menu saved in the\nresource of the given id.<\/p>\n<p>For example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% print id|menu_trail:55 %}\n<\/code><\/pre>\n<p>Could print the list <code>[13, 33]<\/code> if ids 13 and 33 are the parents of the id argument in the menu resource 55.<\/p>\n<p>If no argument is given, it takes menu from the resource with the name <code>main_menu<\/code>.<\/p>\n<p>Instead of a single id it is possible to give a list of ids. The trail for the first id that returns a trail in the menu\nis returned.<\/p>\n<h2>Showing Menu Trail only for submenu items<\/h2>\n<p>It is sometimes useful to suppress the menu trail on top level items. Here is how to do it.<\/p>\n<p>The <a href=\"#filter-menu-trail\">menu_trail<\/a> includes the whole path through the menu to the current page if it is reachable\nthat way. Sometimes it may seem pointless to show the menu trail if we are on the first level of the menu. If we want to\navoid this we need to avoid rendering a trail when it is less than two items long.<\/p>\n<p>One simple condition change to _article_chapeau.tpl from the blog skeleton makes this work:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% with id|menu_trail as parents %}\n  {% if parents|length &gt; 1 %}\n  &lt;h5 class=&quot;chapeau&quot;&gt;\n  {% for p in parents %}\n  &lt;a href=&quot;{{ m.rsc[p].page_url }}&quot;&gt;{{ m.rsc[p].title }}&lt;\/a&gt;\n  {% if not forloop.last %}&amp;raquo;{% endif %}\n{% endfor %}&lt;\/h5&gt;{% endif %}{% endwith %}\n<\/code><\/pre>\n<p>The key here is <code>{% if parents|length &gt; 1 %}<\/code> instead of just <code>{% if parents %}<\/code>.<\/p>\n<p>The <a href=\"\/id\/doc_template_tag_tag_if\" class=\"doc-reference doc-reference-tag\"><code>tag#if<\/code><\/a> tag is now rendering the menu_trail only if there are two or more items in it\nwhich - as I mentioned before - happens when you are at least two levels deep in the menu.<\/p>","slug":"menu_trail","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"e4b04575cf8c0ac4a115be3a4272f76d3cd8b7d17c8b1e09c0955486f151c8c9","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":325,"is_a":["meta","category"],"name":"template_filter","title":"Filters","uri":"https:\/\/test.zotonic.com\/id\/325"},"doc_source_path":"apps\/zotonic_mod_menu\/src\/filters\/filter_menu_trail.erl","publication_start":"2023-06-24T08:18:02Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_menu\/src\/filters\/filter_menu_trail.erl","pivot_location_lng":null,"doc_source_kind":"filter","name":"doc_template_filter_filter_menu_trail","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:28Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_menu","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","erlang_module":"filter_menu_trail","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-02T12:40:28Z","title_slug":"menu_trail"},"uri":"https:\/\/zotonic.com\/id\/1627","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1627"}},"status":"ok"}