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

One Taxonomy with multiple views to show content related to a specific term and referenced content

I have two content-type: Job Organisation and a taxonomy: categories The content type "Job" has a field referenced to "categories" and another field referenced to "...
0
votes
2answers
36 views

Loading content in a View via a sibling entity reference

I think what I need to do is use one Drupal View's results to filter the results of another view. Here is what I am trying to accomplish. I have 3 content types (node types): Blog, Blog Post, ...
0
votes
0answers
14 views

How to override the output of a views field of type comments

My goal is to create a views block that shows the comments of the current node. I succeeded in creating a views block that includes only the comments field of the node ID from URL. However, the ...
0
votes
1answer
27 views

Creating a view with an exposed filter for "is not empty" where all results are shown by default

I'm creating a view. By default, I want all results shown, with an exposed filter for 'has a value' (aka is not empty) and 'is empty'. I cannot figure out how to make the exposed filter work for this. ...
1
vote
1answer
68 views

How to create a view printing the latest 3 nodes with unique entity reference values

I have two content types, CAR and DRIVER. The DRIVER content type contains a CAR entity reference field. So each DRIVER node creation page can reference a specific CAR. The goal is to build a view to ...
1
vote
1answer
25 views

How can I make 3 different menus?

I need to do an Agenda in Drupal 7. The table for the events is more or less already done, but I would need to add 3 days on the top like: Day 1 - Day 2 - Day 3 Depending on which day is ...
0
votes
2answers
40 views

Create a view filter to find node which have no value in a specific field

I'm trying to create an exposed filter for view which allow to find node which have a specific field with no value. It's a field which lists taxonomy terms. This is not possible with view. When I ...
0
votes
0answers
44 views

How do I display nodes of two different content types that use the same taxonomy term?

I have two content types, typeA and typeB. Both the content types have a taxonomy reference field. I created a view for each content type. In the view showing typeA nodes, I want to show also typeB ...
0
votes
0answers
21 views

Taxonomy dynamic dependent exposed filters

I have a content type with two taxonomy term fields: Region and Country. I created some nodes and entered values for those fields. I created a view with both the fields as exposed filters. When a ...
1
vote
0answers
30 views

Where should I include method to pass current selection to entity browser select view?

I'm following this guide https://drupal.stackexchange.com/a/277898/56676 which I found very useful. So, I understand where the first function goes, but when it comes to the method public function ...
0
votes
1answer
23 views

List all values in same row in a view

I have a view that displays the authors of an article and links to their author page. Currently the view outputs each author in its own row as a list. I'd like to have it display the authors in one ...
0
votes
0answers
21 views

Possible use case for hook_views_query_alter or hook_views_data_alter

We have an Event content type that uses a custom module to allow events to occur on more than one date. We have a View of teasers that displays a list of all upcoming events, each teaser displays all ...
0
votes
2answers
31 views

How can I use contextual filters to display a block with field values from a single related entity?

I've found various recipes/threads with the scenario where have a content type A node and want to display in a sidebar block, all the related content type B nodes, with the relationship based on an ...
1
vote
0answers
25 views

Should I use Aggregation or Query Settings > Distinct to remove duplicate results?

I have a basic view that displays published article teasers. The view has a contextual filter on the article content type's tags field, e.g. field_tags. The contextual filter is configured to accept ...
0
votes
0answers
28 views

Listing articles that matches a specific set of filter criteria

I have a Drupal 9 site with three roles: Editor, Reviewer and Author. I use the core Article content type, with one additional field: field_reviewer. It is an Entity Relation to the user that has been ...
1
vote
0answers
20 views

Programmatically set a views filter value on page load (not contextual filter)

I have created some views for an Events content type with field_start and field_end timestamp fields. One of the displays is for 'Upcoming Events'. I want to filter only those events whose start date ...
2
votes
0answers
38 views

How to get content url in views-view-unformatted block template

In Drupal 8, I created template for solr search view views-view-unformatted--solr_search_content--block.html.twig I am trying to print the content link by {{ row.content['#view'].style_plugin....
-1
votes
1answer
25 views

View with multiple blocks, how to specify which is shown?

I have a view that is placed as a block below my main content. Within that view I have block "displays". each having a different contextual filter for their id from url. The problem is when ...
0
votes
0answers
38 views

I get a block that doesn't change on other pages

I have an issue with the contextual filters when I use Content: ID. On the site I get a repetitive, when there are many more recipes. The block remains the same, with two recipes, which is fine, but ...
0
votes
1answer
20 views

Display Node Local Tasks Menu on View

I have a view that shows registrations for an Event (Content Type). This tab is shown in the /node/{node}/edit: This registrations tab refers to the view, which I have inserted in the routing.yml: ...
0
votes
1answer
175 views

Set a Data Value from Text field to Term Reference field

Node has two fields: Text field Term reference field (autocomplete?) The Text field is old and already has 500 nodes with 500 unique values. The Term reference field is new and needs to contain same ...
0
votes
0answers
30 views

Pass parameters from block to a JSON endpoint using taxonomy term from URL

I've been searching for a solution to being able to pass a taxonomy term on a views block that is on a given page using the term name that is in the URL. I agree with my team that it would be a best ...
2
votes
1answer
54 views

How to create a view filter which display nodes if "field1" - "field2" < $amount

I have a content type with 2 fields: field1 and field2 I would like to create a view filter which display node based on a calculation on those two fields. The filter should display only nodes if ...
0
votes
0answers
36 views

How do I change a display plugin class

I'm attempting to modify the definition of a view display plugin to use my own custom class. I used hook_views_plugins_display_alter(), but it doesn't seem it's invoked at all. I've searched in core ...
0
votes
0answers
17 views

Views Infinite Scroll class wrapper goes away when filtering using facets, changing my CSS styling

I have a page with custom css that uses display:grid for content output from my view. The limit I have for what my view outputs is 30. Since the views infinite scroll contains a wrapper around my ...
0
votes
0answers
16 views

Views Jump Menu containing only sibling taxonomy terms

I'm using Views Jump Menu with Drupal 9. Nodes are tagged with a software_version hierarchical taxonomy, following this pattern: ├── foo │   ├── 0.1.0 │   └── 0.2.0 ├── bar │   ├── 0.3.0 │   ├── 0.3.1 ...
0
votes
0answers
30 views

How do I set up a views block that filters contextually on a field included in a paragraph?

I have two content types (ContentA, ContentB) which both use the same paragraph (MyParagraph) as field type “Entity reference revisions.” MyParagraph consists of two “List (text)” fields: ...
0
votes
0answers
14 views

How to save contextual filters (taxonomy) used with one content type to another?

I'm quite new to Drupal and I'm building a site where the user will be able to filter content using taxonomy (for example location, price range free/cheap/expensive,etc.). I want this filter to be ...
0
votes
1answer
60 views

Display Block to retrieve information from Order Item's Product Variant and display rating & review inside product page

I am working on an e-commerce website development. I have the conventional Products -> Product Variants which goes through Order and payment gateway workflow. However, there is something different ...
2
votes
0answers
35 views

Can you rename replacement pattern tokens in views?

If you insert one or more custom text field (e.g. to include some Twig logic), latter fields will see such blocks as {{ nothing }}, {{ nothing_1 }} etc. in the replacement patterns. Can these be ...
0
votes
1answer
64 views

Using Twig in global custom text to check for a specific content type

I am filtering for two content types to display in a view: Artwork Page and Cover Page. I want to change the HTML markup for Cover Page. I have researched and tried many field names for Content Type, ...
2
votes
1answer
57 views

Pathauto alias full path for hierarchical taxonomy terms

My client has content tagged by a hierarchical taxonomy of arbitrary depth. Currently the maximum depth is three, but that could change: ParentTerm └── ChildTerm └── GrandchildTerm Each Term has ...
-1
votes
1answer
24 views

Sum the grouped results in the template

I have an aggregated view result grouped by taxonomy terms and shown like the following. TaxonomyTerm1 1 1 TaxonomyTerm2 1 TaxonomyTerm3 1 1 1 I want the result to be added and shown like the ...
1
vote
1answer
26 views

Modify sorting criteria using views_query_alter

I have a view for the content type events with fields event_name, description, summary, event_start_date, etc. What my requirement is: Sort the events in ascending order of event_date equal or ...
0
votes
0answers
7 views

Rewriting Start and End Dates in Views where Date is stored in single field

using Drupal 7, I have the Profile2 module installed. Within that, I have a field called "Employment Dates" and a user can enter a start and end date on this field. They can also leave the ...
0
votes
1answer
71 views

Twig template for just one page in a view

I have a Drupal view (Product Section) where I have a master view. This is the view I'm currently using for Computers, Cell Phone, and other pages I am still creating. I also have a Product Shop page,...
0
votes
2answers
27 views

Unable to check if variable is empty in views twig

I am trying to overwrite views-view-unformatted.html.twig file and want to check if title variable is empty or not, but whatever I do, it always acts just like it is not empty. I know title variable ...
0
votes
0answers
21 views

How to sum views field value

A have Drupal 8 and a custom module, which adds a custom field to a view. I want to sum two fields in each views row. In my module I sum two field values: public function render(ResultRow $values) { ...
0
votes
0answers
32 views

Nested conditions groups in views filter plugin

I need to nest some "where Groups" on a QueryPluginBase query, but I can only nest first depth group to the main "where" using setWhereGroup. I need to add groups into another ...
2
votes
1answer
31 views

Join with Like in Views Plugin

Attempting to do a join with a LIKE operand in a Views filter plugin. The query looks similar to below; however, when it executes, the LIKE operand is not taken into account and the join is done with ...
-1
votes
1answer
51 views

Jquery to move field above the table - changes during page refresh

I have the below jquery code to move a multiselect field and a button above the table. jQuery(document).ready(function($){ $('#views-form-resources-block-1 .form-item-ka-types').insertBefore($('#...
1
vote
0answers
25 views

Display multiple values in separate rows with view that uses Search API

Yesterday I asked this question, but after realizing the issue was specific to my view relying on an indexed field using the Search API module I wanted to make another post getting more specific help. ...
2
votes
0answers
35 views

Changing how to group by

So I have a content type, "Person," that uses an entity reference to assign each Person a Program. I'm trying to make a "People" page for my site that groups the people by said ...
2
votes
0answers
17 views

Set a dynamic filter value

I want to construct a view with following constraints: Show entries from the content-type XY AND it is authored by the currently logged in user OR Show entries from the content-type XY AND the ...
0
votes
0answers
31 views

Is it possible to define the destination that Views adds to links?

Views has a field to create a dropdown menu and this has the option of having the destination added to those links. This works great. Unfortunately, if the View is used through an AJAX call the ...
1
vote
0answers
165 views

Add additional taxonomy term fields to an exposed filter form

Brief: How to add a custom field from a taxonomy term into a View's exposed filter form? Specific: I have an image field added to taxonomy terms that I want to add to the exposed filter form along ...
-1
votes
1answer
24 views

Taxonomy term relationships

I have 3 taxonomy terms that I would like to expose as filters but I would like to use JavaScript to disable filters as you make selections in the other related exposed filters. For example: Styles ...
1
vote
1answer
43 views

How can I return a 404 error when the contextual filter value is provided in the URL, but the view returns no result?

I'm on building a rest view of nodes using Serializer as formatter. This view has a contextual filter on a plain-text field of that content type. How can I return a 404 error when the contextual ...
0
votes
0answers
15 views

?page=n conficts with the Infinite Scroll Views module

I have one main view with pager where I actually using ?page=n (which can't be changed in my case) to navigate on the main view using the Pagerer module without AJAX. Underneath (with AJAX) I got ...
1
vote
0answers
38 views

How to delete bulk webform submission by filtering webform field value?

There is spam content entered to my website webform page. I wants to clean those records. I have try to do same by using view module. But is there any option to filter the enter field values of ...