Active
Project:
Twig Tweak
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Oct 2025 at 17:46 UTC
Updated:
21 Apr 2026 at 14:41 UTC
Jump to comment: Most recent
It is possible to provide any contextual filters in a drupal_view() call, as arg_1, arg_2, etc:
{{ drupal_view('who_s_new', 'block_1', arg_1, arg_2, arg_3) }} (per doc)
I would love to be able to also provide a value for "Items to display"...
given that the "Items per page" allow setting has been set:

Not seeing a way to currently do this...
| Comment | File | Size | Author |
|---|---|---|---|
| items_per_page.png | 44.69 KB | fizcs3 |
Comments
Comment #2
fizcs3 commentedActually same need with drupal_view_result() too.
I realize it is also limited by what the view's default "items to display" setting is without a way to provide an override in the function call...
Comment #3
fizcs3 commentedLooking into this further...
I see that twig_tweak's drupal_view is being mapped to drupal core's views_embed_view function,
and twig_tweak's drupal_view_result is being mapped to drupal core's views_get_view_result function.
Which it doesn't appear that currently those core functions provide for a way to change items per page...?
Comment #4
chi commentedRight. Views can only accept contextual filters as arguments. Other settings can be changes through request parameters when exposed filters are enabled, but that would be tricky to implement in Twig extension.
Comment #5
anybodyPlease check if this is still relevant and use 4.x as target branch for Merge-Requests (MR) as that's the new development branch. Thanks!