Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 85651

The Views module allows creating lists of entities with a flexible query builder.

1 vote
1 answer
374 views

Render view in code with the proper view mode

very specific view mode (neither Full content nor Teaser, it's created on purpose and themed according to my needs, basically an e-mail oriented output with very different HTML classes than the usual views … However, when I render it from code to be able to use the resulting HTML directly: $view = Views::getView('view_id'); $view->setDisplay('default'); $view->setArguments($args); $view->preExecute(); $view …
Gábor's user avatar
  • 886
1 vote

Render view in code with the proper view mode

It was the theme. The rendering took place under cron and ran under the administration theme rather than the usual one, meaning different twigs. The solution will be to sub-theme the admin theme to ma …
Gábor's user avatar
  • 886
7 votes
Accepted

How to create custom search filter for entity list

Not that complicated and you don't need Views. Most of the functionality is right there, built-in, you only need to add your own bits. … The Reset only appears when needed, just like with the standard Views displays. submitForm() redirects to the URL with the appropriate query (remember to change the route name), resetForm() redirects to …
Gábor's user avatar
  • 886
0 votes
0 answers
27 views

Route to Url with contextual filters [duplicate]

Url::fromRoute('view.view_name.display_name', ['value' => $value]) would be nice but, in the case of views, this only adds query values. …
Gábor's user avatar
  • 886
1 vote
1 answer
393 views

Render view inside block with caching

Basically: $view = Views::getView('view_id'); $args = ['product_id' => $whatever_product]; return $view->buildRenderable('views_block_id', $args); The process basically works but, as usual, I'll have … Views only caches using the block id as a cache tag, so the first rendered view gets cached and displayed in all places. …
Gábor's user avatar
  • 886