Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
35 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 ...
user avatar
1 vote
1 answer
116 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 ...
user avatar
0 votes
1 answer
17 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 ...
user avatar
0 votes
0 answers
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 ...
user avatar
  • 407
0 votes
0 answers
22 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 ...
user avatar
  • 1,007
0 votes
1 answer
45 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 ...
user avatar
1 vote
1 answer
17 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 ...
user avatar
  • 407
0 votes
2 answers
310 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 ...
user avatar
0 votes
0 answers
23 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(...
user avatar
0 votes
2 answers
74 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 ...
user avatar
  • 925
0 votes
0 answers
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 ...
user avatar
0 votes
0 answers
21 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 ...
user avatar
  • 925
0 votes
1 answer
17 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, ...
user avatar
0 votes
0 answers
30 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&...
user avatar
1 vote
0 answers
21 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 ...
user avatar
0 votes
0 answers
18 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 ...
user avatar
  • 1
0 votes
1 answer
38 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: (...
user avatar
1 vote
0 answers
22 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 ...
user avatar
0 votes
0 answers
15 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 ...
user avatar
  • 33
0 votes
1 answer
53 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 ...
user avatar
  • 924
0 votes
0 answers
42 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), ...
user avatar
  • 1
0 votes
0 answers
21 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. ...
user avatar
0 votes
1 answer
38 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: {{ ...
user avatar
0 votes
0 answers
23 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 ...
user avatar
0 votes
0 answers
127 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 ...
user avatar
0 votes
0 answers
14 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 ...
user avatar
0 votes
0 answers
35 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 ...
user avatar
1 vote
1 answer
50 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 ...
user avatar
  • 345
1 vote
0 answers
19 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 ...
user avatar
  • 11
0 votes
1 answer
286 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 ...
user avatar
2 votes
0 answers
25 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 ...
user avatar
0 votes
1 answer
18 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 ...
user avatar
0 votes
0 answers
16 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 ...
user avatar
  • 1
0 votes
0 answers
157 views

How to display the nodes with the reference entity "Group type" of the same type as the current group?

I have a website built with Drupal 9 and I installed the Group module. I created a "Help" content type with an "Entity reference" field that refers to the group type. I have ...
user avatar
2 votes
0 answers
37 views

How to add views aware configuration options to a field formatter?

There is a contrib field formatter module (bg_img_formatter) which has numerous field configuration options. One of these options is a text field which needs to allow for the same views field ...
user avatar
  • 925
5 votes
0 answers
157 views

How does the Geolocation content of a page filter is a Views block?

I have a website with Drupal 9 and the Geolocation module : https://www.drupal.org/project/geolocation I created a content type with a Geolocation field that contains coordinates. My website uses the ...
user avatar
1 vote
1 answer
28 views

How can I disable products so they are unpurchase-able and also display in a view?

I have a view of published products. I want to also create a view of unpublished products, so users can see previous products that were available, but there shouldn't be an Add to cart button on these ...
user avatar
  • 11
0 votes
1 answer
34 views

Getting issue on views import?

Accidentally I have deleted the views relationship field. After that I am getting error when try to open views configuration page. To fix the issue I have exported that view from site configuration ...
user avatar
  • 157
2 votes
0 answers
9 views

How can we create sums of a View's table column values in a header and/or footer?

We have a View with multiple decimal field value rows. We need to create a sum (add all of the values) for these columns in a header and/or footer of the View. I see there is a D7 module called Views ...
user avatar
  • 1,007
1 vote
1 answer
291 views

How to get a rendered views field value programmatically?

Yes, I see there are many answers already posted here and elsewhere for this; but sadly they are all wrong. These answers include any of the following: $view->style_plugin->getFieldValue($rid, '...
user avatar
  • 925
0 votes
0 answers
29 views

Ho can I add a class to a specific row in views-view-field template?

I have created a custom views-view-field template and added some custom html and views field similar to this <div class="{{ fields.my_text_field.content }}"> {{ fields.my_media_field....
user avatar
  • 133
0 votes
0 answers
15 views

How to create a View to display nodes with empty entity referenced fields

Can anyone please help me to create a view when entity referenced field is empty. I have a body field where various paragraph fields are referenced. I would like to get list of nodes whose body field ...
user avatar
0 votes
1 answer
80 views

How to limit access to the Views pages of the user account?

I created Views page with tabs in the users account. The problem: If I am user 3 and I go to the page of user 56, I have access to the page. I have searched in the Contextual filters on the Views page ...
user avatar
0 votes
1 answer
184 views

Display Fulltext search query string on Search Results page

This is probably much simpler than I'm imagining. Client wants to display the user-entered search query string, with a label (like Search Query or You Searched For), at the top of the search results ...
user avatar
  • 1,950
4 votes
1 answer
98 views

Allow SVG in Views Rewrite Results

I am rewriting the results of a field in a View and depending on the value of a field, I want to display an SVG icon. I can use TWIG to do the conditional logic and that works great, but it won't let ...
user avatar
  • 345
0 votes
1 answer
105 views

Composer installation missing files from Core [closed]

I just attempted to update Drupal 9.2.10 to 9.3.0 using composer and received the following error during the database update. views module Update sort_identifier Failed: Drupal\Component\Plugin\...
user avatar
  • 13
2 votes
0 answers
19 views

How do I access current_page value in views twig template?

In views-view.html.twig, I'm trying pager['#views_plugin'].current_page, but don't get any value.
user avatar
  • 41
0 votes
1 answer
78 views

How do I hide the tab menu link when a view is empty?

I have a view with a menu tab link and an attachment, which displays rows of other nodes, depending on the contextual filter. This view has a custom path(/node/%node/view-custom-path). How do I show ...
user avatar
  • 79
1 vote
1 answer
79 views

How do I pass a node field value as view argument to another entity reference field?

The issue seems simple, but I can't get any documentation for it. I have a content type with two drop-down fields: field_company which lists taxonomy terms and field_protocol which is referencing a ...
user avatar
0 votes
1 answer
38 views

Combine Aggregation with Pivot Table in Drupal Views

I have some views that use pivot tables. Their purpose is to display an attribute (for example, the gender) and a year value (for example, the birth year), using a third field named ID. The gender is ...
user avatar
  • 121

1
3 4
5
6 7
302