Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
10 views

Is it possible to "group" a Views field when using the "Content" display format?

We have a View using the Content display format (not Fields) because we're using a theme template to output the nodes. This works great but we also need to group to nodes by a field on the node (...
  • 1,069
0 votes
0 answers
19 views

Dynamically generate Form API select list of routes to page displays of a known View

Given a known View, how would one dynamically generate a Form API select list of the routes to its Page Displays? In my case, I have a Search API View (view.search) with a default site-wide search ...
  • 2,040
0 votes
0 answers
15 views

How do I link to a Views Page from a systemAdminMenuBlockPage page?

I have a custom module that I have a systemAdminMenuBlockPage in that I'd like to link to various content administration Views pages from. I basically have a custom Configuration menu item doing this ...
1 vote
1 answer
29 views

get the value of a drupal token inside a twig code

does anybody knows how to get the value of a drupal token inside a twig code(global text field) block in the views's header? I can get the value of the token outside the twig code block, but not ...
1 vote
0 answers
35 views

How to calculate the sum of duration in a view?

How to calculate the sum of duration in a view ? I would like to know the total duration of an album after having entered the duration of each track on the disc. I use the Duration field and Views ...
  • 11
0 votes
1 answer
25 views

Exposed Views Filter of Usernames in a list instead of autocomplete

I have an exposed filter with a relationship to a reference field in my content type to users. Currently this exposed filter lets me filter by inputting a username, but its only autocomplete. Is there ...
0 votes
1 answer
22 views

Views Exposed filter can't input username to filter. Only works with User ID

I created a custom View, where it shows all of a specific content type. In this content type I have a field that is a user reference called "Assigned to". In this view, I want it exposed so ...
0 votes
0 answers
22 views

Twig template for field component of specific form [duplicate]

I'm using template hints to attempt to theme a specific part of a single form. I have a custom template for a views block (block--views-exposed-filter-block--search-custom-page-1.html.twig), but is it ...
  • 545
-2 votes
0 answers
17 views

Automatic Popup in Leaflet View [closed]

hopefully someone can help me figure this out. I've got a Leaflet Map view, filtered via Search API and Facets. When someone gets a specific result for a location via searching for the name, the map ...
  • 1
0 votes
0 answers
23 views

How to sort the views by a column from a custom database table?

I have a custom database table my_apps. This table has nid and uid columns. I have created a view, which is displaying some nodes. I want to sort this view from that custom table. Like ORDER BY COUNT(...
  • 2,755
-4 votes
0 answers
15 views

Geofield map default marker icon appears to be big. How can we decrease the marker size on map [closed]

Geofield map module default marker icon appears to be big. How can we decrease the marker size on map. In Drupal i am using geofield map module with lot of nodes which comes as marker in map. But the ...
-1 votes
0 answers
25 views

Exposed filter of events by month, day and year

I have a view which displays the list of all the events published on a website I am working on. I have been requested to have a functionality that filters these events by month, day and year. The ...
0 votes
0 answers
18 views

Exposed Filters Manipulation and product attributes

I am using Better exposed filters in my view and the filtering criteria are Product Attributes of the Product Variations i have setup. It is working but the attributes are showing as Titles and i ...
2 votes
1 answer
74 views

Views aggregation of content values across two columns

I have a test content type that has a test name (A or B) and whether the Test is a pre-test or a post-test. Given the following data from that content type: Test Type A Pre A Pre A Post B Pre B ...
1 vote
0 answers
23 views

How to use groupBy on query based on the search API views?

My search api query returns a list of articles with its nid and field category. I would like to group by category. I mean 1 article by category. Is there a way to accomplish this? I tried via the ...
  • 44
0 votes
1 answer
42 views

How can I add a button to every row of custom column?

I have created a custom column in the content listing section using hook_views_data(). I want to add a button to the every row of that custom column. Can anyone help me with this issue? function ...
1 vote
0 answers
19 views

How to get comment's field value in view

I want to create rating of companies based on values of comments fields. Companies rate table: Comment form example: Here's my Drupal settings: Nodes (type "Company") with comments. ...
1 vote
0 answers
18 views

How can I find all the nodes that use a hierarchical vocabulary taxonomy term and reference a child term but not its parent term

I am using Drupal 7. I have a content type "Public Resource" that uses a hierarchical vocabulary called "Resource Topics" that has up to 3 levels (parent->child->child of ...
0 votes
1 answer
23 views

Hide/remove "Last" label/icon in views pager

I don't want my user to click the "Last" label on the views pager, but I can't find a way to remove this "Last" label even I leave the "Last page link text" field empty, ...
  • 1
0 votes
0 answers
78 views

How to display a shipment method as an order item row in csv or table view

I am creating a csv order view with a relationship to pull in referenced order items, and it gives a row for each order item as expected : Order 1, item 1 title, item price, Order 1, item 2 title, ...
0 votes
0 answers
27 views

Custom sorting using a MySQL statement instead of simple field

I'm using a view to list products from db index. I want to implement a custom sorting (my goal is to sort by current taxonomy term page, products having a specific node field field_MY_FIELD_NAME = ...
1 vote
1 answer
28 views

Avoid group of revisions history view duplication

My taxonomy View lists all revisions grouping by different columns, by adding revision fields for each value, and get the filter "published" removed. The only filter is: city name (not null)....
0 votes
0 answers
19 views

Views: How to filter content by taxonomy terms that are not selected?

I have a view of a specific content type that can be filtered by two different taxonomies A and B. Some nodes that have the taxonomy term A1 also have the term B5. Now when I filter only by the term ...
0 votes
0 answers
29 views

How to change date format of exposed filter input value?

By default view exposed filter ,filtering the data in such way. http://mydomain.docksal.site/events?combine=&field_event_categories_target_id=All&field_start_date_time_value=&...
0 votes
0 answers
40 views

Webform entity reference view?

I want to have a field to select a webforms within a paragraph using an entity reference field in the "Views: Filter by an entity reference view" reference mode, so that I can reduce the ...
  • 309
1 vote
0 answers
37 views

Programmatically get the results of aggregation SUM values

On my Drupal 8.9.18, I have a View (Page display) displaying all nodes type "Vehicles". This view has two exposed filters: Entity Reference Field (Select List) Authored On Field with ...
  • 11
0 votes
0 answers
31 views

Unable to turn on alternative maps styles using Leafleat More Maps

I'm trying to change the map style in a Drupal 10 site that I'm building locally. I have installed and enable the 'Leaflet' and 'Leaflet More Maps' modules. However when I navigate to the properties ...
  • 1
0 votes
1 answer
44 views

How can I dynamically change the default value for views exposed filter based on the terms weight?

I have an exposed filter in a view is referencing taxonomy terms from specific vocabulary. The operator allows selecting a term as the default value for that filter. What I want to achieve is to ...
0 votes
0 answers
18 views

Date filter not working with start date

I wish to filter view for node type 'event' by start date > today, or alternatively by >= YYYY, if relative date is not possible. Neither is working. The view SQL see below doesn't apply the ...
0 votes
0 answers
17 views

In views, how can I make unpublished comments invisible to users who do not have permission to view unpublished comments?

I have a view that lists recent comments. Problem: If an unpublished/unapproved comment is on a published node, the comment is visible in the view even if the user looking at the view does not have ...
  • 193
1 vote
0 answers
47 views

How do I add a query condition to the QueryPluginBase in hook_views_query_alter()?

Using hook_views_query_alter() for a view configured as a REST feed, I'm attempting to add an additional filter value to the query, based on the presence of multiple filters passed via the URL. I need ...
  • 11
0 votes
1 answer
50 views

sort api solr search using custom view field using hook_views_query_alter()

Drupal 9.4.8. Search api solr 4.2.9 I have created a search api solr search in views One of the fields included in this view is a custom view field: node_date_raw_field From module hook_views_data():...
-1 votes
1 answer
54 views

How will I highlight active item in glossary view?

I have created a glossary view which shows alphabetical navigation to filter the list. But I can't find a way to highlight the active link - would like for "G" to be highlighted if I am ...
0 votes
0 answers
32 views

Modifying a view runtime?

I wanted to remove click sort from a view and couldn't find anything. So I tried to force: <?php /** * Implements hook_views_pre_view(). */ function sd8_views_pre_view(ViewExecutable $view, $...
1 vote
1 answer
54 views

How can I display no results text in a template?

I have added no results behaviour text to a view called Events which is a page. This template I am using has a twig called views-view--events--page_1.twig. I want to add the no results text to this ...
  • 137
0 votes
0 answers
33 views

How to re-write exposed form multi-select query key identifiers?

I'm wondering if there's a way to update the "identifiers" (not sure of the terminology) of a key from the URL when setting an exposed form field to multi-select? The key pattern in the URL ...
  • 1,857
0 votes
1 answer
31 views

How can I add a start and end date range in views exposed filter for Drupal 9 webform submission data?

I have created a view which displays all the webform submission data, but when it comes to views exposed filter for the dates I'm unable to find a way to add a webform submitted date as a range, I did ...
0 votes
1 answer
38 views

Set restrictions to nodes displayed after submission [closed]

I have a content type (AppointmentApplication), which can be used from anonymous users; all the information can be viewed by administrator users. I don't want all the entered information to be shown ...
0 votes
1 answer
36 views

How can I filter by taxonomy term after the first level filter?

I have two content types (Book and Video), each with its own vocabularies: Book Vocabulary with Newspaper, Novel, and Magazine; Video Vocabulary with Movie, TV Show, and Documentary. I have a view ...
0 votes
0 answers
46 views

Scroll to view's result after applying exposed filter

when a user submit the view's exposed form the site is reloaded and the page's focus is not on the view's results but on the very top of the page. I use quite a few exposed filters above a table view. ...
  • 111
0 votes
1 answer
37 views

Print total value in footer but unable to modify footer value using hook_views_pre_render() [closed]

Using below code to modify footer value in hook_views_pre_render() but it's not working function hook_views_pre_render(ViewExecutable $view) { foreach($view->result as $result) { $totalamt = $...
1 vote
1 answer
51 views

How to display a user’s published content on their account?

Does anyone know how to display every article (or content type) a user has published on their "my account" view? To clarify, I only want it to display that specific user's published content ...
0 votes
1 answer
26 views

How can I show child categories in the parent category page?

I have created a new vocabulary with some extra fields and these taxonomy terms. Parent 1 Child 1.1 Child 1.2 Child 1.3 Parent 2 Child 2.1 Child 2.2 Child 2.3 Parent 3 Parent 4 Parent 5 In the ...
1 vote
1 answer
61 views

How to pass paragraph id from layout builder to view?

I have asked this question before but in a different, more convoluted context. This is a simpler example. I have a paragraph type which I use Layout Builder to define it's layout. In that layout I ...
  • 1,007
1 vote
0 answers
22 views

List all groups of a user in one row as a multi-field

I want to list all the users and groups they are member of in one table, one row per user. I have a simple view that lists all users in the system. I added relation to group content membership and a &...
  • 21
0 votes
0 answers
28 views

Articles are displayed multiple times

I have two taxonomies (category, with subcategories, and tags) and a content type (article). An article can be in exactly one (sub-)category but can have multiple tags. I'm trying to create a view ...
1 vote
1 answer
59 views

How to render the correct variation price in catalogs?

I have a product catalog built using search api, facets, and views like this: https://docs.drupalcommerce.org/commerce2/developer-guide/products/marketing-products/product-catalog-facets. My add to ...
0 votes
1 answer
41 views

How can I make the relation I am using in a view work again?

I'm currently migrating from Drupal 7 to Drupal 9, and i'm rebuilding all views (as I can't find a good migration procedure for views from 7 to 9), also trying to understand the changes (this is a ...
1 vote
1 answer
76 views

How to hide the tabs on the user account if it is not his account? [duplicate]

My users have permission to view other users' accounts. Only the "View" tab page. This is exactly what I want. On the user account, by default, there are three tabs: View Shortcuts Edit ...
  • 1
0 votes
1 answer
24 views

How to differentiate the state when a contextual filter is applied?

Hello to all the Drupal community. I've recently faced a challenge to visually modify some parts of my view's template for the state when its contextual filter is applied. Some details are as follows: ...

1
2 3 4 5
303