Hot answers tagged

3

UPDATE As discussed here, this issue was caused by some missconfiguration at view level and normally should not occur. Read the full post to get the full picture on how you can step on this error. ORIGINAL ANSWER I'm adding my findings as answer since comments have limitations both on styles and length, but by all means THIS IS NOT an actual answer to the ...


2

I Agree with Leigh. I regularly use the filter operator 'is between'. Click on the 'add' button aginst filter criteria, select start date and enter 1st jan 2020 then 31st December in the end date box and job done.


2

They are used to uniquely target views elements with javascript for AJAX purposes. If you have enabled the use of AJAX on your views display for pagination, filtering etc without page reloads, then removing or changing those might break it. If you are not using AJAX at all, you should be fine, although this comment is not a promise or guarantee!


2

The plugin was missing the proper annotation (added now in the question). Views plugins use Annotation Discovery. Adding something like the following solved the problem: /** * My custom serializer * * @ViewsStyle( * id = "hindi_custom_serializer", * title = @Translation("Hindi Custom Serializer"), * help = @Translation("Serializes views row ...


1

In order to fetch resources under specific Megazine, you need to have the Magazine ID on your contextual filter instead of the Article ID. Here is my suggestion: Play with your URL pattern to add the magazine ID to it (You can do this using Pathauto and Token Module). Once you install those two modules define a URL Pattern for your articles (/[node: ...


1

The following works for me without a problem. I'm not sure where my method differs from yours: Relationship: Comments of the node Contextual filter: Author uid using comments relationship Provide default value: "User ID from logged in user" Use aggregation: Yes (to avoid duplicate nodes) That's all, and it works like a charm.


1

Yes, you can easily create an override for views-view.html.twig which will only apply to a single View. Taking the example from Views template files: View, named foobar. Style: unformatted. Row style: Fields. Display: Page. views-view--foobar--page.html.twig views-view--page.html.twig views-view--foobar.html.twig views-view.html.twig So ...


1

I figured it out! Instead of just adding Category as a single field in the View and trying to figure out how to configure that to show each Category for a Thing row but only one Category header per group, I have the Category field on there twice - one that does not display multiple in one row (for the headers), and one that does display them all within one ...


1

In my case, the '$result->_entity' was empty, so I had to get the value from the '$result->_object' : function YOUR_THEME_preprocess_views_view__YOUR_VIEW_ID(array &$variables): void { foreach ($variables['view']->result as $result) { $node = $result->_object->getEntity(); $title = $node->get('title')->getValue()[0]['value']; ...


1

Ok, I solved it like this: function THEMENAME_preprocess_views_view_field(&$variables) { $view = $variables['view']; $field = $variables['field']; $rows = $variables['rows']; if ($view->id() == 'VIEW_NAME' && $view->current_display == 'DISPLAY_NAME') { if ($field->field == 'FIELD_NAME') { foreach ($view->field as $fieldId => $field) ...


Only top voted, non community-wiki answers of a minimum length are eligible