Problem/Motivation

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:
items per page graphic

Not seeing a way to currently do this...

CommentFileSizeAuthor
items_per_page.png44.69 KBfizcs3

Comments

fizcs3 created an issue. See original summary.

fizcs3’s picture

Actually 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...

fizcs3’s picture

Looking 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...?

chi’s picture

Right. 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.

anybody’s picture

Version: 3.4.1 » 4.x-dev

Please 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!