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
3 views

how do i sum (and count ) a field across all nodes

I have a decimal field on a content type. I want to sum the values of this field across all nodes of that content type and display them with the total count on a page. I tried to do this with views ...
0
votes
0answers
5 views

how to implement 'most viewed/popular' content displayed in the sort filter [duplicate]

I tried with radioactivity but its not working as expected because we are using layout builder for our content types.
0
votes
1answer
10 views

How to do views bulk operations on all matches, not just a page

I have a lot of nodes to delete on a Drupal 9 site. I thought I could use the Content view, select the node type, click select all and Delete. However it seems that select all only selects the visible ...
0
votes
1answer
23 views

The values returned from hook_node_access_records() aren't considered to allow access

I am implementing a solution in Drupal 9 where users are allowed to see only the nodes that belongs to their same group. If a node doesn't belong to any group, t hey should be able to see it. I've ...
0
votes
1answer
36 views

Updated from Drupal 8.9.20 to 9.0.0, but can't run update.php due to errors

Here's what I get when attempted to run update.php: Requirements problem Errors found MISSING UPDATES FOR: SYSTEM The installed version of the System module is too old to update. Update to a version ...
0
votes
0answers
14 views
+50

Link to images in form view creates wrong url

I noticed this after drupal 9 update, but I've tried to find the exact moment when it was broken and I couldn't find it. I use S3 and cloudfront for images so maybe the problem is related with that ...
1
vote
0answers
11 views

Programmatically load the same view multiple times with different contextual filters values

I'm trying to load a view X times but with a different contextual filter value each time. My code generates the correct amount of view blocks, but they are all the exact same. They all correspond to ...
2
votes
0answers
35 views

Views performance: Teaser vs Fields

I have to create a view on a Drupal 7 site which will have 6/8 node fields. There will be some logic for which I will have to rewrite results as well as create a views-view-field-XX.tpl.php template ...
0
votes
0answers
19 views

Search views broken/missing after upgrading Drupal 8.9x to Drupal 9.3x

Getting error in search FILTER CRITERIA after upgrading Drupal 8.9x to Drupal 9.3x please look into the image. We are using : solr server v6.6 Modules : search_api_solr - 4.2.3x search_api - 1.22x ...
0
votes
0answers
14 views

Dynamically add field to Views result row

i use views_data_export to export a list of nodes to excel. These nodes of type "proposition" have many paragraphs fields, with multiple values. By default, views_data_export export all ...
0
votes
1answer
22 views

Display metatag description of nodes in taxonomy term views

In Taxonomy term views, where are displayed shorten nodes I want to display node's metatag description instead body summary, but it doesn't work. I'm using Metatag module with it's submodule Metatag: ...
0
votes
0answers
10 views

Add a Close Button to a Views Content Results (D7+)

Requiring a content Close Button on a Views Results field Pane, I would like to know how one adds it to a field result in order for the user to 'dismiss' it. I have a Panels page showing the user a ...
0
votes
0answers
30 views

How can I filter based on unique taxonomy term values?

I have a content type "book". One of its field "field_language" referencing to "language" taxonomy term. field_language can have only one value. Consider this is the ...
1
vote
1answer
108 views

How do get a value from field in if/else statement

In a custom views-view-fields.html.twig I do print a list field (field_status) without issues. The values are: new|New old|Old But if i want to do an if/else statement for printing different div ...
0
votes
1answer
15 views

Node reference field autocomplete and allow multiple selections in views

I recently pdated my Drupal core to 8.9 and suddenly a functionality stops working. I have a "Recipe" content type, it has a field of "Category" (field_category) which is Entity ...
0
votes
0answers
7 views

Using group module, get SUM from the groups content in a view

I am using the group module and each group can create "tournaments" content. Within that content is a multivalue paragraph that contains a user id and a number field. Using views, I would ...
-1
votes
0answers
26 views

Views "freezes" SQL: strange bug since D7 and till D9

Sometimes I face with the following problem: views "freezes" SQL query. So I change filters, add/remove fields, but I see the output as well as SQL query is the same. The output can become ...
0
votes
0answers
14 views

How to make a View's exposed filter value match the Context Filter term name provided in the View path?

In Drupal 9 we have a View of Nodes with a Context Filter (Has Term Name to Term ID) and an exposed Filter for the term (called Resource Type). I can go to the Views path (/downloads) and add the term ...
0
votes
1answer
15 views

Disable theme debugging html comments in particular view?

we are running commerce site, still tweaking some bits, so we have still twig debug set to true, but site is already online.. we have XML feed for exporting commerce products to couple of price ...
-2
votes
0answers
16 views

What is the url of the entity linked to a FieldItemListInterface

I am checking the code of this field-formatter-plugin especially the function that format the output of a view: /** * {@inheritdoc} */ public function viewElements(FieldItemListInterface $...
1
vote
1answer
9 views

Disable certain rows of a Entity Reference Source view

I have a field that is an entity reference on a piece of content. I created a view that is an Entity Reference Source and set the reference type on the field to that view. When editing the content, I ...
-3
votes
0answers
24 views

MISSING UPDATES FOR: VIEWS

After update D8 to D9, when I run drush updb I get this error: [error] The installed version of the /Views/ module is too old to update. Update to a version prior to 9.0.0 first (missing updates: ...
0
votes
2answers
38 views

Passing parameters to view blocks in Twig

Running Drupal 8.9.18 I have a string that I want to pass to a Drupal block for use in a contextual filter. In a twig template I have a view that creates a simple list of the terms to use. I extract ...
0
votes
0answers
14 views

How to use views query alter to show filtered content according to tags

I am new to Drupal and started learning hooks. I am trying to use hook_views_query_alter to show related content to user according to it's preferred tags. function related_content_views_query_alter(...
0
votes
2answers
43 views

How to cache View block by content language?

I have a very simple (block) view to list a node's title. This view has an id from url contextual filter and a single filter to filter on Content language set for the page (by URL prefix). This block ...
0
votes
0answers
4 views

Disable Views exposed filter choices that would return an empty set when using multiple filters

I am using Better Exposed Filters with Ajax to display multiple taxonomies that users can select to drill down into a list of results. Taxonomy A, Taxonomy B – if a user selects a choice from Taxonomy ...
0
votes
0answers
15 views

Does Views block caching include language in cid?

I think this is likely a core bug (in which case I know it is not meant for Drupal Answers) but thought I would check here first to see if possibly I have just missed something in configuration? I ...
0
votes
0answers
5 views

ElasticSearch Views integration not working with multiple words

In Drupal 9 I have setup ElasticSearch 7. I have added a Search API View in which I have added field to search through the "rendered HTML" field. This seems all pretty basic if you ask me, ...
0
votes
0answers
19 views

Can't find "starts with" for Filter criteria In Views (indexed field for taxonomy)

I created a view using indexed fields (search api) to list a taxonomy. I used the rest export checkbox so I have an api endpoint for my view. I am not able to find a filter criteria "starts with&...
1
vote
0answers
16 views

Is it possible to create a view of a user's content and content they've flagged?

I'm trying to build a view that displays nodes authored by a user AND nodes flagged by the user (but are authored by other users). All the nodes are the same content type. I can create the two views ...
0
votes
0answers
15 views

Allowing specific users to flag/book mark content that is then displayed on a specific page for their team to view publicly

I need help figuring this out, I need to allow specific users (a designated role) to create listings (a pre-built views) of existing content by selection (bookmarking) and share it with their own ...
0
votes
1answer
18 views

related by entity reference module views in Drupal 9

I have two content types: Company: body field_events (Entity reference) Events body field_company (Entity reference) I have created a view that has this setup: View Settings: Fields: (...
1
vote
0answers
19 views

better search results for view taxonomy terms

A view with a taxonomy term field doesn't let you configure 'contains' like you can using title or body. Using "one of" as the alternative, a "first-name second-name" entry does ...
0
votes
0answers
13 views

How to duplicate a view as a page for another view

I have 5 views in the back office, each view contains in the display a single page with different fields and filter criteria and other configuration, I would like to gather all the 5 views/pages as 5 ...
0
votes
1answer
20 views

views_embed_view() ignores template file using Ajax

I have a view shown in two ways. Once I show it as a normal block and one time using views_embed_view() in combination with Ajax. For the regular block I created a views-view-list.html.twig template ...
0
votes
0answers
18 views

Overriding views title with full taxonomy hierarchy

My Situation: I am trying to list my content with a taxonomy hierarchy, building up a views based navigation. To achieve this, I created a second vocabulary for my hierarchy terms (2 layers, mixed), ...
0
votes
0answers
18 views

Views filtering by two values from same field and comparing with another time field

I have a customer which works with buses and passenger transportation.Now he would like that all routes would be visible on a site and guests could filter routes by source and destination points. ...
0
votes
1answer
33 views

How can I print view/edit/comment links? [closed]

I have a view that uses the "View content," "edit content," and "view comments" fields. I can't figure out how to print these in a custom twig template. I've tried: {{ ...
0
votes
0answers
18 views

How to get id from context filter in views?

Please tell me how can I get the node id from the url in views? Is it possible to pull it out of the context filter so that after passing it to the form via the prepopulate module? I am creating a ...
-2
votes
0answers
28 views

Condition in views

My task is to make a drupal 9 website for accounting books in the library of an educational institution. I have created three types of materials: book card (book) reader issue. When issuing a book ...
0
votes
0answers
10 views

How to word-wrap field label from a view

I'm still new to Drupal views, how do I word-wrap a field label from a Drupal view? I know there are style settings within the field and there's one called, "Customize label HTML". Do I just ...
0
votes
0answers
26 views

Better exposed filter for block view doesn't appear

I created a new content type and a display page to show a listing of all my new content type pages. I'm trying to create a better exposed filter block on my page for the sidebar, but when I try to add ...
0
votes
0answers
11 views

Rewrite media field (PDF) in views

In Drupal 9 i use a media field (field_pdf) in views to display PDFs. As formatter i use thumbnail. How can i rewrite this field to open that PDF in a new window on click? My different settings are do ...
0
votes
0answers
32 views

Apply an AND condition in WHERE clause

I want to sort view results basing on the selected start and end dates using exposed filters. So I want to AND the conditions in the WHERE clause. How can I do this? I tried the following code, but it ...
1
vote
1answer
28 views

Drag and drop to sort taxonomy weight in a view

I need to create a custom admin view to replace the default taxonomy term listing page for a given vocabulary. The reason is that we have added custom fields on the vocabulary and the admins need to ...
1
vote
0answers
18 views

Show 2 results for each of 3 different content types

I am using Drupal 8. I have 3 content types: videos, images, and podcasts. I want to have a single view that shows two of the most recent posts of each content type. For example, out of 4 videos and 2 ...
0
votes
1answer
77 views

How do I use {{file_url()}} to get image field URLs in views-view-fields.html.twig?

I tried to use the following code in views-view-fields. {{ file_url(fields.field_featured_image.content.0['#item'].entity.uri.value) }} When I use that code, I get this error. TypeError: Argument 1 ...
2
votes
0answers
21 views

Page with multiple displays on the same path does not respect the different access rights

With Drupal 7, it was possible to define in Views a page with several displays, having all the same URL. By ordering the displays in descending order of access level (Administrator first, Anonymous ...
0
votes
1answer
14 views

Show taxonomy field in View

I have taxonomy called Hardware Type and it has field Short Code. Now content-type Hardware's has this taxonomy and I have a page which lists all Hardware. I want to show Hardware type's short code ...
0
votes
0answers
12 views

Filtering webform submission results in a template file or in Views

(Drupal 7) My situation is the following: I am using one single webform on my Drupal page that shows up on the page in different places for different events and gets a unique ID for each event to ...

1
2 3 4 5
300