Questions tagged [views]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

Entityqueue - Get field values from the queue

First off, i'm very new to Drupal. Kindly help me and forgive if im being a noob. Im using the module - Entityqueue https://www.drupal.org/project/entityqueue Im created a view block for a entity ...
0
votes
0answers
24 views

Combine two Media fields in Product types and Product variation types

i'm drupal beginner, i install drupal 8 commerce 2, i create a media field in Product types and create another media field Product variation types also. when i create new product, i want to give user ...
0
votes
0answers
10 views

Get group number in views-view-grouping.html.twig [duplicate]

Is it possible to get the group number inside the views-view-grouping.html.twig? So the first group gets the number 1, the second number 2 etc. Something like: <div class='group-nr-{{ group_number }...
-1
votes
1answer
28 views

How can I update a map to display view results with an exposed filter? [closed]

I want to use a view to render locations on a map, and dynamically update the map when a user filters the locations. I have a view that displays a list of "Location" content types. That view ...
-1
votes
1answer
20 views

How do I list all names of the same group type?

For a Group type (Birds), I tried to create a View in Drupal 9 to list all groups of that type, but I end up getting a group title entry for every node, for example this list. Birds groups Hawks ...
0
votes
1answer
18 views

Views filter group “or” operator not working

I'm having an issue with the "or" operator in a view acting like an "and" operator (at least, I think that's what it's doing). The view is meant to display articles with either &...
3
votes
0answers
38 views

How efficient is views_get_view_result?

I admit; I am not a fan of writing length SQL queries and I am a huge fan of Views. Many times when I need a list of nodes (such as processing nodes in a cron task), I have created a View and then ...
-1
votes
1answer
46 views

Linking two different views for the same content type

I have a content type with around 50 fields with three groups A,B and C(grouped in views). I have a view which shows the new content added in table format(limited fields). I do not want the table to ...
0
votes
1answer
24 views

When using a grouping field in an HTML list, is there a way to determine the group/loop number of the current content being rendered?

I want to be able to determine what group number is currently being processed to that I can treat the output of the first group differently than subsequent groups. Unlike rows, I do not see a way to ...
0
votes
0answers
20 views

View won't save end date configuration as filter criteria

I'm using Drupal 7 with views 7.x-3.15 and Date 7.x-2.9 I have a date field for an "Events" content type. Events can sometimes last more than 1 day, so I have enabled an associated end date. ...
1
vote
1answer
46 views

How to add “rel” attributes to all external links throughout the website?

I'm trying to add attributes for external links such as the rel="noopener noreferrer" for all the external links where target="_blank". I've tried using modules such as the ...
0
votes
0answers
11 views

Replace 'all' for 'All' at any exposed filter criteria

I'm trying to replace the 'all' value for 'All', because I'm getting an error if I use it as 'all'. Is there any way to accomplish this? Before: price_selector=5&price[]=5&play_styles=All&...
0
votes
0answers
19 views

Adding html tags to the Views module title area

One of the common things I do with Drupal 7 Views module is that I use the small tag (<small>) to provide a brief description for the view block/page. For example; Quick Search<small>...
0
votes
1answer
14 views

Views block that shows all references to current node (cross references)

I'm confused with views filters and relations... In my articles I have a field (field_article_reference_nodes) that references other nodes and shows these as a link. Now I want to attach a view to ...
0
votes
0answers
16 views

Node field autopopulate based on taxnomy term value

I have a Vocabulary called Cars. Each term has two fields (name [default drupal field] and status, Example: [name] Mercedes E220 - [status] Available) In my node/content type I want to create two ...
-1
votes
1answer
29 views

Create a list of webform submissions sorted and searchable by data in user submitted form fields

I am using Webform 6.x on Drupal 8. I would like to create a list of submissions that are sorted and searchable by the user entered data within the submissions. I am able to generate a list of of the ...
1
vote
0answers
16 views

Add taxonomy term description to views-view-fields--taxonomy_banner.html.twig

using taxonomy term view to render my products in Drupal 8.9 with commerce 2 . I am trying to add the term description under a banner .. but struggling to find what I need to add. new to twig,and ...
0
votes
0answers
27 views

Access 'content' or 'node' variables inside View context

I have a view where there was a file type field. So I added it to the view and rewrote the result for it: <a href="{{ field_documento }}">{{ title }}</a> The above line results ...
0
votes
1answer
26 views

View listing element by date, exception for the first one

I have a view which list a content type order by date. I just want to add a simple condition : the first element of the list must the one with ID = X, even if it was created long time ago. How can i ...
0
votes
0answers
26 views

Multiple comma-separated values in View contextual filter only producing an OR query, not an AND

I have a View with one contextual filter, a taxonomy field. Entering a single value works as expected: the results are filtered by the taxonomy term ID. The requirement is to allow an AND combination ...
0
votes
1answer
65 views

How do I place a block with Twig Tweak? [closed]

I've placed a view block via Twig Tweak in page-front.html.twig before and it worked fine. That was on Drupal 8, but now I'm on Drupal 9. This's what I would have done in Drupal 8. <div id="...
0
votes
1answer
31 views

How do I set the default value for results?

I'm on Drupal 9 and I have an AJAX view with a page display and an exposed filter block and a single filter exposed, "Search: Fulltext search". The Search API module is configured to search ...
1
vote
1answer
22 views

Alphabetical case insensitive grouping of results

My question is about grouping results alphabetically in a case insensitive way in Drupal 8. I have a view displaying people's names alphabetically grouped by last name. My problem is the following: I ...
0
votes
0answers
21 views

views_get_view_result additional parameters not working

I'm trying to call views_get_view_result from a block class to load in a view. My view has two contextual filters (one for a year, one for state of node). So I'm trying to call views_get_view_result ...
0
votes
1answer
20 views

How do I create a filter based on the current user's role in a search_api based view?

I would like to filter a search_api based view using the current user's roles as input. I don't see a contextual filter for the current user in my search_api based content view at all. How can I ...
0
votes
0answers
21 views

Adding a view in the Paragraphs Selector

I have a drupal 9 website where I created a View "Homepage - article overview". On the homepage I have paragraphs enabled (text/image | 2 columns | 4 columns | Full width image). I want to ...
0
votes
0answers
42 views

Drupal 8 purge module to allow SOLR index replication before cache invalidation happens

I am having a Drupal 8 website running over Acquia Infra. I have recently configured Purge module to invalidation cache over Acquia varnish and Cloudflare when cache-tags gets Invalidated. Problem: ...
0
votes
0answers
19 views

Is there a way to write something like a fieldformatter/widget but for exposed filters shown in a view?

Here for example, I would like to make a widget or some way, that I can use this type of drop down always for one type of exposed filter, such as a published status. Thanks!
2
votes
0answers
25 views

Under what circumstances are views wrapping divs required?

When I embed a view, I'm seeing the following wrapping divs (Note: I'm using just the core views module templates): <div class="views-element-container"> <div class="js-view-...
-2
votes
1answer
49 views

How to insert a custom form into views header?

I have a custom form and I want to insert it into a views header. What is the Drupal 8 way to do it?
0
votes
1answer
63 views

Change page title

I've created a view to display products based on the taxonomy vocabulary Categories. I followed a few how tos and check for answers on drupal.org, here & other websites but none is working. I ...
0
votes
1answer
55 views

How to list entities and sort them by delta?

I have a "stations" and "railways" node types and a custom "notification" entity type. In "railways" node type I have an entity reference field ("...
0
votes
0answers
22 views

How to remove text from the body field in views and leave only <img> tag?

Good evening, i have articles that contain texts and images, i would like to know if there is any way in views to strip or remove the text from body field leaving just the img tag, i don´t want to use ...
0
votes
0answers
16 views

How do I programmatically disable the pager?

I'm using a view with infinite scroll. I want to disable the pager for the default view and keep the pager if we select some options from filters. Can we do it via code?
1
vote
0answers
32 views

How do add row striping CSS classes in Views?

I'm sure that on older versions of Drupal (6 or 7?) Views that showed as tables automatically had odd/even striping background colours. Is there a UI option for this in D8/9? I've done it in code like ...
-2
votes
1answer
45 views

Is there a way to sort view asc or desc using twig

Is there a way to sort view asc or desc using drupal_view('vn', 'vmn', sort order) in twig or Can sort we views_embed_view() in controller
0
votes
1answer
63 views

How to put view results in an entity reference field?

So the scenario is like this: I have to create a "node" which has an entity reference field which can hold multiple values. I am looking for a way to be able to select view results to be ...
0
votes
0answers
20 views

How can I use range filters for strings?

I have created a view in Drupal 7 in which the dates are in text format, eg 2020-10-12 and I want to filter date ranges using between or >= and < but there doesn't seem to be such an option for ...
0
votes
0answers
19 views

Rendering view better expose filter in drupal does not containg term id in drupal 8

I have created a view with better expose with term taxonomy And render in twig file Drupap_view('viewname','machinemname') Now I want use contextual filter based on term id dynamically But I see ...
1
vote
0answers
21 views

Adding a “Like” operator via views query alter for taxonomy term name

I am trying to add a "Like" operator via views query alter for my taxonomy term name. My view is a block setup with a contextual filter set to show all results as shown below as I want to ...
0
votes
1answer
16 views

How do I set filters to reset automatically on new search?

I have a search and some filters on a drupal 7 site. If I search a term, for example "stuff", and there are 30 results, I can click a checkbox filter (let's call it FilterA) on the side and ...
0
votes
1answer
23 views

How to filter content by a specific taxonomy term when vocabulary allows multiple values?

I have defined a vocabulary that allows multiple terms to be checked for a Content Type and I would like to create a View that could gather all the data from that Content Type but grouping the results ...
0
votes
2answers
39 views

How to filter my view of Groups to show results matching Term A or Term B

I am adding taxonomy terms to groups (using the group module) and want to use the terms to filter groups within a view. However, my exposed filters don't seem to work. There is no error, but the ...
0
votes
1answer
40 views

Where are the field formatter settings?

When I'm managing a display for an entity and select a field formatter, some formatters have options available (see screenshot 1). However, when I use that same field formatter in Views, there's no ...
1
vote
3answers
86 views

How can I override the markup of a view I printed in a template file?

I installed the Twig Tweak module on my site to render Views on the home page. I want to make the display mode frontpage_tasks for the current user, his account, his stores and his groups. {{ ...
0
votes
1answer
21 views

View Taxonomy Term List with Exposed Has taxonomy terms (with depth) filter

I have view list of terms of a vocabulary. The terms of it have an entity reference field of another vocabulary (with hierarchically organized terms). I would like to filter the terms by that entity ...
1
vote
1answer
17 views

View based on months or days - display certain items during specified times of the year

I am trying to create a calendar-type view that will display links to specific nodes during certain months of the year. For example, this would show 'Taxes' in Feb and April, 'Travel' from May to ...
0
votes
0answers
13 views

View to get information for the user entity reference using contextual filters

I have two content types and each one has a user entity reference field. I want a view using contextual filter that shows the information of the content types when I pass the user ID referenced for ...
0
votes
0answers
13 views

How do I set a grouped exposed filter of boolean fields in a view?

I have a view with fields used as filters and exposed to user in a dropdown. They are "grouped" in the filter section. These fields are boolean. I can't get them to work together. It's ...
1
vote
1answer
39 views

How do I add a view between display fields of a node?

I have a view that displays a table at the bottom of every node. It's part of the content of the node so I want to have the "comments" section below the view. However, the comments are a ...