{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-05-30T05:48:04Z","object_id":{"id":1303,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_wires","title":"mod_wires","uri":"https:\/\/zotonic.com\/id\/1303"},"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:48:04Z","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":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:48:17Z","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"}},"subject":{"objects":[{"created":"2026-09-09T13:48:17Z","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:17Z","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:17Z","object_id":{"id":2586,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_search_and_discovery","title":"Search and discovery","uri":"https:\/\/zotonic.com\/id\/2586"},"seq":3},{"created":"2026-09-09T13:48:17Z","object_id":{"id":2624,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_wire_action","title":"Wire action","uri":"https:\/\/zotonic.com\/id\/2624"},"seq":4},{"created":"2026-09-09T13:48:17Z","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:48:17Z","object_id":{"id":2673,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_javascript","title":"JavaScript","uri":"https:\/\/zotonic.com\/id\/2673"},"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":2027,"is_a":["text","documentation","reference","template_action"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2027"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_template_action_action_moreresults","page_url":{"en":"https:\/\/zotonic.com\/docs\/2027\/moreresults","x-default":"https:\/\/zotonic.com\/docs\/2027\/moreresults"},"preview_url":null,"resource":{"version":3997,"pivot_location_lat":null,"title":"moreresults","is_authoritative":true,"body":"<p>Show more results of the current search query inline on the page.<\/p>\n<p>The moreresults action is an alternative to using a next\/previous pager to paginate through search results. Instead,\nmoreresults lets you load more results from the current search, directly onto the same page. This feature is similar to\nTwitter’s <em>more<\/em> button, Slashdot’s <em>many more<\/em> button, and others.<\/p>\n<p>Using it is quite simple. The only special thing you need is that every result item should go into its own template. The\nminimal example is something like the following:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{% with m.search.query::%{ cat: &quot;media&quot;, pagelen: 10 } as result %}\n  &lt;div id=&quot;results&quot;&gt;\n    {% for id in result %}\n      {% include &quot;_item.tpl&quot; %}\n    {% endfor %}\n  &lt;\/div&gt;\n\n  {% button text=&quot;more...&quot; action={moreresults result=result\n                                   target=&quot;results&quot;\n                                   template=&quot;_item.tpl&quot;}\n  %}\n{% endwith %}\n<\/code><\/pre>\n<p>The number of items that get added is equal to the <code>pagelen<\/code> setting of the search.<\/p>\n<p>When there are no more items, the <code>moreresults<\/code> button will get disabled automatically.<\/p>\n<h2>Arguments<\/h2>\n<p><code>result<\/code><\/p>\n<p>Points to search result that you want to show more of.<\/p>\n<p><code>target<\/code><\/p>\n<p>Container that the new items get appended to.<\/p>\n<p><code>template<\/code><\/p>\n<p>Contains template that will be appended.<\/p>\n<p><code>catinclude<\/code><\/p>\n<p>Render <code>template<\/code> through a <a href=\"\/id\/doc_template_tag_tag_catinclude\" class=\"doc-reference doc-reference-tag\"><code>tag#catinclude<\/code><\/a>.<\/p>\n<p><code>is_result_render<\/code><\/p>\n<p>Normally the template is called for every row in the search result. This is useful for lists. Sometimes all results must\nbe rendered together, for example when special grouping is needed. Add <code>is_result_render<\/code> to render all results together\nin one template.<\/p>\n<p>Example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{% with m.search.query::%{ cat: &quot;media&quot;, pagelen: 16 } as result %}\n  &lt;div id=&quot;results&quot;&gt;\n     {% include &quot;_items.tpl&quot; %}\n  &lt;\/div&gt;\n\n  {% lazy action={moreresults result=result\n                              target=&quot;results&quot;\n                              template=&quot;_items.tpl&quot;\n                              is_result_render\n                              visible}\n  %}\n{% endwith %}\n<\/code><\/pre>\n<p>Note that here we use the <code>lazy<\/code> scomp, which will perform the action if it is scrolled into view. Because we are using\nthe <code>lazy<\/code> scomp we have to add the <code>visible<\/code> argument so that the re-loaded <code>moreresults<\/code> action will be wired for\nvisibility and not for a click. In this way the page loads automatically more results if the user scrolls down.<\/p>\n<p>The template <code>_items.tpl<\/code> displays the found pages in rows of four elements:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{% for ids in result|chunk:4 %}\n   &lt;div class=&quot;row&quot;&gt;\n   {% for id in ids %}\n       &lt;div class=&quot;col-md-3&quot;&gt;\n           &lt;h3&gt;&lt;a href=&quot;{{ id.page_url }}&quot;&gt;{{ id.title }}&lt;\/a&gt;&lt;\/h3&gt;\n           &lt;p&gt;{{ id.summary }}&lt;\/p&gt;\n       &lt;\/div&gt;\n   {% endfor %}\n   &lt;\/div&gt;\n{% empty %}\n   &lt;div class=&quot;row&quot;&gt;&lt;\/div&gt;\n{% endfor %}\n<\/code><\/pre>","slug":"moreresults","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"352809b84fb375dc99cf2d708b5dee1c4b17ba1017df914cc39904d138dadc74","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":326,"is_a":["meta","category"],"name":"template_action","title":"Actions","uri":"https:\/\/test.zotonic.com\/id\/326"},"doc_source_path":"apps\/zotonic_mod_wires\/src\/actions\/action_wires_moreresults.erl","publication_start":"2023-06-24T08:17:52Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_wires\/src\/actions\/action_wires_moreresults.erl","pivot_location_lng":null,"doc_source_kind":"action","name":"doc_template_action_action_moreresults","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:51Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_wires","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":"action_wires_moreresults","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-02T12:40:39Z","title_slug":"moreresults"},"uri":"https:\/\/zotonic.com\/id\/2027","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2027"}},"status":"ok"}