Questions tagged [views]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

How to apply a sort criteria to multiple displays without erase each individual criteria?

I have a view with multiple displays and I have some sort criteria applied to all the displays and one applied individually to each display. Now I have to add one more sort criteria to all displays. ...
0
votes
0answers
23 views

How to make a View only show it results if the last of multiple exposed filters has a value selected?

I have a View with three exposed filters. We do not want to show any results until the user has selected a value for the last filter. Is this possible?
1
vote
0answers
21 views

Parent contextual filter

I'm using drupal 9 for a project with a large taxonomy structure. On the parent page I want to show the child terms of the node. Multiple guides i've found have suggested using the contextual filter ...
0
votes
1answer
29 views

How do I set up an article view that validates both article and category?

I'm working with Drupal 7, and trying to get a view set up that will display blog categories and articles based on their category. The category is a Taxonomy - Blog Categories - let's assume it's: ...
1
vote
1answer
41 views

How to create a view of Media images that do not have any Alt Text

For accessibility purposes I want to create a view of Media images that do not have any Alt Text. Creating a view of Media images and also displaying Alt Text is not difficult, as explained is this d....
1
vote
1answer
36 views

How to set the href with the pathname of the current page in it?

Inside a view I have a block for which there is a field called Global Perspective. Inside the block override , I have rewrite rules which overrides teh out of the field with custom text. <div class=...
0
votes
1answer
22 views

Filter content type by media type

I have a content type that has a media field that can contain audio, video or image, I created a view and I want to filter the view depending on the media type is that possible using Drupal views or ...
-1
votes
1answer
47 views

How to debug and find variables on twig themes

I'm trying to create a theme for a drupal web site, but I find it difficult to get variables. Here is an example: to get an image form a view I wrote this line row.content['#row']._entity.field_image....
3
votes
1answer
51 views

How to get a view result programmatically without exposed filters respected

I have some views of display page which I do not want to show to public if there would not be any result when accessed without any exposed filters set. I have a custom views access plugin and a custom ...
0
votes
1answer
23 views

Allow to filter (in a view) on a datetime field of a custom entity

I have created a custom entity as follow: Here is an extract of my entity definition in modules/custom/bank_operation/src/Entity/BankOperation.php Notes: 1- As you can see, I have changed the value ...
0
votes
1answer
24 views

How to add an article to a page automatically

What I want to do is to add the title and the body of an article I create on my homepage just as you would do it for a news. I've been trying to make this work but I can't find a way to do it without ...
0
votes
0answers
28 views

Clean pagination URLs

I'm currently upgrading my site from Drupal 7 to 8 and I'm having trouble with the pagination URLs. On the Drupal 7 site we use the Clean Pagination module which changes views pagination to be /news/...
0
votes
0answers
18 views

Views agenda page not updating (still cached)

I have a Views page to create an agenda of events. The views has a filter to show only agenda items that are in the future. I created a similar setup for multiple site but on this one the agenda is ...
0
votes
1answer
56 views

Show latest content date from group content type

I've a group type vendor with following groups: V1 V2 V3 Each group is associated with content type notes as shown below: Notes (Content Type) with nodes associated with groups: N1 (Group: V1) N2 (...
0
votes
0answers
13 views

Filter view by entity sub-queue?

Is it possible to filter a view by a sub-queue within an entity queue? My current setup is: Entity queue with multiple sub-queues created (I've only created 2 sub-queues at this point.) Setup a view ...
0
votes
0answers
7 views

How do I add a token for upcoming or past event?

How do I create/find a token in Drupal 7 that determines if the date value is past today or not (i.e. upcoming or past)? I'm creating a map using Views and Leaflet, and I'd like to change pin color ...
3
votes
1answer
203 views

Issue trying to implement the Swagger UI module in Drupal: ReferenceError: SwaggerUIBundle is not defined

I am trying to integrate the Swagger UI module into Drupal 8 after adding custom REST routes/resources. I have installed the OpenAPI, OpenAPI_UI, and OpenAPI_Rest modules and I'm able to get a valid ...
0
votes
0answers
20 views

Can't get distinct rows from taxonomy view

Drupal 8 has a problem with creating distinct views, and the distinct views module hasn't been ported yet. I've been researching this today, and haven't found a good solution. I wrote a custom hook in ...
0
votes
1answer
31 views

views.view.unformated.html.twig taxonomy conditional if/else

I am trying to get to the field_news_type term_id/label. I can print the field and I get the term label. Need guideance to be able to select which one I want to use. {{ fields.field_news_type.content }...
0
votes
2answers
43 views

How do I get the title of a referenced node from a field?

I am trying to build a View that lists People's Profiles which are referenced to a Team via a Paragraph (within that Profile) to print out the Name of the Person and other data from the Profile. The ...
0
votes
0answers
6 views

Seeking advice how to tokenise specific views settings (from geofield and geocoder modules) to recognize tokens

I am seeking advice on best practices to tokenize drupal views filter settings to process tokens and work with the token and token_filter module. I have asked the specific question here: Steps to ...
0
votes
0answers
24 views

How do I get the path or url to commerce product for views-view-fields.html.twig

I use the commerce module and VIEWS to build a product list. For this product list I like to have an output like this: <ul> <li> <...
0
votes
0answers
25 views

Change View Slideshow slide dimensions

I have the Views Slideshow module running a slideshow of 4 items in it and the background image is set to an image style that scales to 695px height (and no width setting). This also happens when I ...
0
votes
0answers
33 views

How to use one of the 2 context filters in a view (with an OR)? [duplicate]

I have a view with 2 relations with the store for 2 different entities. I want to filter the view with the store id for the 2 relationships. I created 2 context filters in the views. You must use the ...
0
votes
0answers
19 views

How can I exclude the shown node without reducing the row count?

I have a view block for related content in which I've configured a contextual filter ("Content ID from URL") such that, when displaying the block on a node, that node node is excluded from ...
0
votes
0answers
49 views

Steps to create a geofield view proximity search for unrelated content

I am using geofield, leaflet maps and views to try to create a view of nodes of a content type B within a specified proximity distance of an origin specified in another content type A. A and B do not ...
3
votes
1answer
46 views

What's the difference between indexed and non-indexed field in Views and Search API?

I'm using Search API with a database backend and Views to build the search results page. More specifically, I'm using fields in Views. When selecting fields, I see two options for example: Title ...
1
vote
0answers
40 views

How to render a view in an ajax callback

I am trying to develop a custom module to ajaxify the commerce form block. I tried using dc_ajax_add_cart and ajax_add_to_cart but they were not addapted to my project. I have the following callback ...
0
votes
1answer
16 views

I can't filter the child view based on a value from the parent view

I have read many of the questions asked on this site, but none of them suited my problem. What is the need to make a Users view that shows below its created contents. I have a website with 3 roles. ...
0
votes
1answer
11 views

alter query view by adding fields in an andGroup within an orGroup

I have a multilanguage site with two languages: English and Dutch. Not all nodes are created in both languages. Some nodes even have no language ('und', 'zxx'). I want the default Drupal provided ...
0
votes
1answer
22 views

Block the node which I am currently in

I am discovering one problem on my page - as a content I have some recipe. Under it, I've created a block which is displaying "Simular recipes". And now, this block is displaying some ...
0
votes
1answer
13 views

Create a view of the first entityreferenced child item from a multifield for a list of parent nodes

I have a node type A containing a multifield of entityreferences to another node type B and using only the views admin interface I want to create a list of the first type B child entityreference on ...
1
vote
0answers
27 views

How to filter published content using view with REST

I'm using Drupal 8 and I've created a view with REST. I would like to filter my content, so I've created a field criteria and I've added a Published field and exposed. When I use /my-view-path?status=...
1
vote
2answers
34 views

Use theme template with specific Views

I have a D8 subtheme of Bootstrap and on the homepage I have 2 Views (2 carousel views). I turned on twig debugging so I could see which template file(s) is (are) being used, and where it starts and ...
0
votes
1answer
11 views

Display a certain page in a view

Here is what I'm trying to do is display a certain page in a view instead of all of the basic pages. How would I go about doing that?
0
votes
0answers
25 views

Views field override and use it in Global: Custom Text

In Drupal8, I have created a view of content and add a relationship of the user account field which is referenced entity of the content. So, Basically I have one content type and in the account fields ...
0
votes
0answers
9 views

How to display content tagged with child terms in views?

I have a taxonomy vocabulary general in which I have a reference field to user roles allowed_roles. I have two taxonomy terms. A and B where A is the parent of B. Now I selected test_role in the A ...
0
votes
0answers
60 views

How to add filter criteria by current date in views

I am using Drupal 9 and have a content type with a field "Publish until" (datetime). I want to add a filter in views that it will compare the date in this field with current date. I found a ...
0
votes
1answer
55 views

Contextual Filter Path Alias

I searched for this for some time now but couldnt find an anwser. I am using drupal 9.1.5 and pathauto. I have content types department and depratment news. The news are linked to the department. So ...
0
votes
0answers
20 views

How to aggregate values from fields in Paragraphs based on value of another field in that same paragraph, and display in an aggregated Views table?

Hopefully my title makes sense... I am setting up a Drupal 9 website for internal use as a financial reporting engine and a CRM. I am making use of the following modules: Paragraphs Views Viewfield ...
0
votes
0answers
14 views

unable to load the field_media_img properly within the bootstrap style

While creating a view I would like to add {{ field_media_img }} in a <div class="card-img-top">. Therefore I created a view with 5 fields, all "exluded from display". And a ...
0
votes
1answer
33 views

Views rest export does not update

I have two websites. On website 1 I have a calendar showing upcoming events. Next to a regular views page I also created a views rest export page with 6, of the most near in the future, upcoming ...
0
votes
0answers
11 views

field widget form element not updating #attributes via #ajax callback

I am trying to do a simple update to a form element in my field widget, I have a start and a end dates in the field widget and I need the start date to be the min date of the end date, so I call an ...
0
votes
1answer
61 views

hook_views_query_alter() not working?

Very new to web development and even newer to Drupal, and I have some questions that I would really appreciate if anyone could answer! Here's my yml file, [Site name] is actually just the name of our ...
1
vote
0answers
52 views

Facets with 40000+ taxonomy terms make page load slow

I am running Drupal 8.8.1. I have Search API Solr 8.x-2.2 and Facets 8.x-1.3. I have 40,804 taxonomy terms. I added this taxonomy term in my solr index as string. I already have a view page . I added ...
0
votes
1answer
82 views

How to deal with block cached for anonymous user?

I have placed in the site's home, via twig, a views block of nodes with a random sort and obliviously no cache active. Therefore, at each page reload different nodes appear. The problem is that block ...
0
votes
1answer
48 views

How to use “content entity” type in a View?

I have used the "content entity example" coming from the example project. This example module/: defines a "Contact" entity; it can have extra fields, displays can be configured (...
0
votes
0answers
17 views

Fields not appearing in View Rest API unless Bypass group access control

I have a simple content type with lots of fields that I am attempted to expose via the views api. When calling from Postman as an unauthenticated user some of the fields are coming up empty. The view ...
0
votes
0answers
13 views

Unable to use pathauto aliases for taxonomy terms in conjunction with views pages

I'm trying to set up pathauto aliases for a number of vocabularies to work alongside corresponding view pages. However, in doing so, I'm running into a 404s ("The requested page could not be ...
0
votes
0answers
36 views

How to eliminate duplicate results in a view?

I have a view in a D8 site displaying results of the content type "Projects", sorted by the taxonomy "Project area": I'm getting duplicate results in my views output. I've tried ...