Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Create view with n-n relationship

I have two content types Survey and Publication.- In Survey I created a relation to the Publication using "field_survey_publications". - In Publication I created a relation "field_publication_surveys"....
-2
votes
1answer
16 views

in layoutbuilder view slideshow to broad in some resolutions

I'm using Drupal 8.8.5 with Layout Builder enabled for the content type "page". If I includ a views slideshow as a block in some widths this slideshow intrudes into the blocks of the second row of my ...
0
votes
0answers
16 views

Set 'And/Or' conditions for view filter criteria

I have a view with bunch of filter criteria. Of those, I have zip code and miles fields. I am writing the below query to add a WHERE clause to my view query. function mymodule_views_query_alter(\...
0
votes
0answers
60 views

Add Is-Active class on custom link in view

How can I add Is-Active class on custom link path in view. I have created block of taxonomy term name and format is Grid view. I have added field "Name" and in its configuration given custom path link....
0
votes
0answers
106 views

Programmatically add the argument to a paragraph view

We're using paragraphs on a Drupal 8.8.5 with paragraphs 8.x-1.11. To help relieve some data entry, I've created a module that auto-populate a custom content type, Student Page. This content type has ...
0
votes
0answers
11 views

Page view with multiple filters for blog name, category, and tag filters

Building a blog using Category and Tag taxonomy lists. Also have a "Blog type" taxonomy list. Content type of Blog Article that is the entry for each article. It includes ER fields for adding the ...
0
votes
0answers
19 views

Get rank form a list to show on node twig html

D8 question: I need to show country population rank. How can I show the country's own ranking on the country node (eg:4 for italy). What I tried: I've tried to get rank via block but view result ...
0
votes
0answers
22 views

views: Only show total count (header), no rows

Use case Show the number of user accounts created within a date range. Date range selection is exposed to the visitor. Attempt with views With views, we get the exposed filters for free and don't ...
0
votes
1answer
35 views

Get parameter from current url

How can I get parameter i.e node id from URL in views link path . Eg. - suppose in taxonomy term's view I am giving field name's custom link path is "document/getParameterFromCurrentURL/{‌{tid}}". ...
0
votes
1answer
29 views

Custom views filter to select roles

I have scoured the internet trying to find information on how to achieve this functionality to no avail. I am hoping I can get an answer here. I have a content type called 'Server' on my website. ...
0
votes
1answer
28 views

How can we show the difference between values in consecutive rows in views

I am building a site where users will fill webforms (these are quality of life questionnaires). Users will fill the same form several times. I want to show the change in the value of fields in the ...
0
votes
2answers
38 views

How to get different image styles in the same view?

I'am a newbie, and I want to make a simple view with an image field (in article nodes), that looks like this layout : And for this, I don't want to use CSS rules to resize the view rows images, for ...
0
votes
1answer
22 views

Add custom orderBy in ViewsSort plugin

I'm attempting to sort the results of a View by matching one of the Entity IDs in the result set to the referring URL Entity ID. I'm trying to do this in a custom Views Sort plugin. I did some ...
0
votes
1answer
21 views

Separate exposed sort form from exposed filter block

Is is possible in Drupal 8 Splitting exposed filters and exposed sort & pagination i.e. placing sort & pagination inside a separate block and filters in another block? Right now there is no ...
0
votes
0answers
17 views

How to access entity id in view of custom entity revisions?

Edit: it has since appeared, but I don't know how I did it! I have created a view of revisions of a custom entity type. I would like to group them by entity ID. But I don't see the entity ID ...
0
votes
0answers
39 views

hook_node_access_records() or similar hook for a view

I need to create a permission system using a node reference field. In this scenario nodes are products and users are printers. Site administrators can assign printers to each product and printers can ...
0
votes
0answers
19 views

Exposed filter override a textfield with a select field works only once

I have a code which works for using the title of a field as exposed filter select but it works only for the first time it is used afterwards (and because of ajax) it goes back to the state of field ...
0
votes
0answers
21 views

Access plugin to determine access by contextual filter value, no caching

I want to create a view access plugin that determines access based on a the value passed to a contextual filter, and as a consequence, I don't want the value returned from access() to be cached. I ...
0
votes
0answers
7 views

Is there a way to make a view show current user content along with a following flag?

I am working on a project powered by Drupal 7 and I would like to have a page (Frontpage) powered by the views module which will show content (nodes) from the current logged in user and also content ...
0
votes
0answers
14 views

Field is shown but not filtered

A client has a site with a view (content pane from panels) containing fields from a "Custom" content-type. I say the content type is custom because it's not based on the Content view, but this. ...
0
votes
2answers
33 views

How to apply image style in a views-view-fields--[view]--[machine-name].html.twig

In a views-view-fields--[view]--[machine-name].html.twig, I have {% set images = row._entity.field_image %} {% for image in images %} <div> <div class="img"> <img class="...
2
votes
1answer
36 views

What operator is equivalent to “Is not greater than or equal to”?

I have a view showing a list of events. The events are sorted by a date field, which a user can use to input the event starting date/time. However, I want the events removed from the list once the ...
0
votes
0answers
15 views

How do I show the menu link title?

I'm trying to show the title of a menu-link (see screenshot) in my view based on a Search API content source, but it seems that it wouldn't get indexed. These is what i've done: using drupal 8.8.4 ...
0
votes
1answer
23 views

Contextual filter by node reference ID

Since good 10 years I work with Views in Drupal. Seems I am just to stupid to get it :) I tried really every combination but I am not able to put out a working block view with articles, which are ...
0
votes
0answers
17 views

Translation Issue for paragraph and Views

For a couple of days, we are facing an issue in translating the paragraph. While creating the paragraph, we are not able to check the "Users may translate this field" field. So we are not able to ...
0
votes
0answers
14 views

Views aggregation is turning my date field to integer

Edit: This is a duplicate of Maximum on date field and Views aggregation issue. I've made a view using aggregation on a date field (revision created date). I want to show the minimum date for a group ...
0
votes
1answer
18 views

Read time value of node in view

I am using Read time module for calculating the read time for each node. Value is getting inserted in the database table correctly. But I didn't get an idea about how can I get this value in view. ...
0
votes
0answers
11 views

List type field causes a wrong query with field groups

I need to set a views filter for some products I have. Products are nodes and they have some properties like width and depth and load capacity. These are all of type Number (integer). Then they have ...
0
votes
0answers
14 views

Autocomplete for a reference field with taxonomy term content

I'm trying to create a Paragraph with a Views Reference field. The View itself has a context filter, which filters the node entities I created by the tid of a taxonomy reference fields. This all works ...
0
votes
1answer
11 views

The view is not filtering the duplicate nodes

i have a view which is not filtering the duplicated nodes and i tried couple of solutions but it looks like they are not working. The code I am using is the following. function ...
0
votes
0answers
16 views

View exposed filter for two boolean fields combined as one checkbox

I have a view for users, and I want a combined filter for two boolean fields as one checkbox. If checked -> display all users who have at least one of those field values as true If unchecked -> ...
0
votes
1answer
20 views

Using a Paragraph field value as a View filter

I am attempting to create a view and paragraph combination that allows for site authors to customize the content that they want to display. What is currently working: Within my site is the content ...
0
votes
1answer
17 views

Contextual filter doesn't work with the name of the entity reference, it only works with its ID

why is the contextual filter below only working the the id of the entity reference ID? I would to search by name like by "Oceanography" or "Ecology and Evolution", but i'm not sure how. If i add a ...
0
votes
0answers
21 views

Hook_form_FORM_ID_alter to alter views exposed form

I am attempting to create a function which will alter the exposed form of a view in order to display a certain image instead of the button which says 'Apply'. I have the code below and I could use ...
0
votes
1answer
23 views

How can I pass display exposed filter in views-view-unformatted.html.twig?

I would like to display an exposed filter inside views-view-unformatted.html.twig rather than views-view.html.twig due to specific UI design?
0
votes
0answers
17 views

Display title of ER field instead of target_id (uid) that uses a view with a user field?

I created a views for Entity Reference to be used in a content type ER field (select list) in order to make available all department names that are contain in user profile field called "departments". ...
0
votes
1answer
20 views

Provide unique values from a user profile field in a content type field (How to use DISTINCT in ER View)?

My users profiles contain a field with department name. How can I make the unique values from department available in a select list within a content type field? i.e. Sales, Marketing, IT, etc. (to ...
0
votes
1answer
55 views

How to access fields value in views-view--[viewid]--[view-display-id].html.twig template [duplicate]

I'm trying to customize a View in Drupal 8 where I display a Bootstrap Carousel. What I've managed to do so far was the right template name, by specifying the viewid and view-display-id. The view ...
1
vote
1answer
25 views

Can Views output “raw” text field data?

I have a view that shows the Body field of several book pages. The text format for these pages includes the Markdown filter. I want to export the body field data as the original markdown without ...
0
votes
0answers
10 views

Nodereference field to use other field than title

I am using node reference field with autotagging and want to use field other than title. Is it possible? I have already tried a views with reference and the field other than title but it only changes ...
0
votes
0answers
12 views

Translatable Referenced Entity field as filter for View

I have a multilingual Drupal 8.7.10 site (English and Czech, in this case). Content types Article and Basic Page are translatable and both have some Entity reference field referencing some Media type....
0
votes
0answers
28 views

How to configure SQL plugin in a View Filter Plugin

I'm trying to write a plugin to get Commerce Stock Level field working with views, so I can get it to work correctly with Entity Browser(the operator runs on the last transaction instead of the ...
0
votes
0answers
11 views

Translated taxonomies are not showing in the view

I have set up a multilingual site. I have translated the taxonomies but when I see the page in french the taxonomy are in English. I am using views to display the content in the table. you can visit ...
0
votes
1answer
20 views

Expose a filter to turn a different filter on or off

I have a view of items that have a due date, and I want to be able to expose a boolean filter "Is overdue by more than 30 days" I can create a filter on this due date as a relative date filter "<= ...
0
votes
1answer
71 views

Cron error: LogicException : Render context is empty

In a custom module (sel), I have this code: function sel_cron() { $accountSwitcher = Drupal::service('account_switcher'); $account = \Drupal\user\Entity\User::load(1); $accountSwitcher->...
0
votes
0answers
15 views

json file from authenticated api location

GET https://clubapi.prosoccerdata.com/teams HTTP/1.1 x-api-club: x-api-key: Authorization: now i need to setup the query settings to a secured json location where headers are needed how add these ...
1
vote
1answer
64 views

How to troubleshoot entity error

How can I tell which entity is throwing this error (on all pages)? TypeError: Argument 4 passed to Drupal\views\Plugin\views\display\Block::__construct() must implement interface Drupal\Core\...
0
votes
2answers
28 views

Create a View from custom database

I love the features the view provides in Drupal. Sortable tables, Filters, as well as ability to use external modules like views bulk export. My problem is that I want to display a separate database (...
1
vote
1answer
28 views

Change exposed filter date format with Search API

We are using Search API for a customer website and we have a View with a start and end date exposed filter. The view only filters correctly if we use the m/d/Y format, which is not valid in Brazil, ...
1
vote
1answer
30 views

How do I implement access checks based on referring nodes in the grants system?

Following a suggestion in another thread here I'm trying to rewrite the access restrictions that I developed using hook_node_access (and that are working well, so far) in Drupal's grant system (i.e. ...