Questions tagged [views]
The Views module allows creating lists of entities with a flexible query builder.
15,177
questions
-2
votes
1
answer
96
views
Colorbox and complex modals [closed]
Is it possible to make the colorbox popup take more complex content than just an image and a caption?
On a drupal 9 site I have been asked to modify a simple colorbox gallery to include a long/...
0
votes
0
answers
39
views
Use exposed filter "Has taxonomy term (with depth)" for a specific field and not the all the content
My content type has 2 fields related to the same hierarchical taxonomy.
How can I expose a view filter that allows a search "with depth" on only one of these fields and not on all the ...
0
votes
2
answers
43
views
Apply or expose a filter based on the value of a field in a referenced entity
I have a search_api SOLR view of downloads on path /downloads that filters on current language and has a contextual filter on category so /downloads/foo shows downloads that have the category "...
1
vote
1
answer
191
views
How do I debug A block ajax issue on a custom theme?
I'm receiving and ERROR " An error occurred while attempting to process /views/ajax?_wrapper_format=drupal_ajax: ajax.$form.ajaxSubmit is not a function" when clicking on link in views block ...
0
votes
1
answer
67
views
Format telephone numbers for values
I have created a webform with telephone field, the submitted data is displayed in a views table, however the numbers in submitted data are in random format such as 1234567890, 234-987-9870, how do I ...
1
vote
0
answers
72
views
Search API Facets: Filtered Results to Map (Leaflet) Shows No Updates to Views Page
When using post search results via a Search API Facets for node data, the initial results are displayed as a map content type (Leaflet) but when filtering down to further fields, the results page ...
0
votes
0
answers
15
views
Show List of Custom Blocks with same referenced term as the term on it's term landing page
I have a term which itself has a reference field for taxonomy terms. On the term's landing page, I would like to include a view (block), that shows custom blocks with the same referenced term (I did ...
0
votes
0
answers
38
views
Access field from current page in block or view
I have a custom content type. (d9)
I need to access some fields from the current page in a sidebar area. Essentially I need to make a "get more info about "field from current page" here ...
0
votes
1
answer
78
views
Custom links.task for secondary tab loses primary tabs
I created a Views page and wanted to place it as a secondary task (tab) under admin/content.
I added an entry to my custom module's links.task like this:
mycustom.admin_orphaned_pages:
title: ...
2
votes
1
answer
59
views
What is the equivalent of field_view_field()?
I am working on some code where I need to get some fields from a node. For the body, I want to display the summary, or the trimmed body if the summary is not there.
I found an example on the web using ...
0
votes
1
answer
129
views
Modules are not updating to the latest version
I have some websites in the drupal. I need to update the security modules in the old version to the latest version. The list of security modules I tried to attempt is as below
1)colorbox (current - v2....
0
votes
1
answer
133
views
Programatically sort a merged view by a row value
I am using the following hook_views_pre_render to merge 2 views_data_export views.
function hook_views_pre_render(ViewExecutable $view) {
if ($view->id() == 'commerce_orders' && $view->...
1
vote
1
answer
134
views
View of Node revisions exclude first revision of each node
I have a view of Node revisions. I want to only show revisions that are edits. I want to exclude the first revision of each node.
I think filtering for created <> changed would work, but I could ...
0
votes
0
answers
21
views
how to create commerce product attributes which gets it's values from a view
I want to fill the product attributes select list with data like:
location1
location2
location3
These locations are general and gathered using a custom module. In views I can create a list with these ...
0
votes
0
answers
92
views
Change icon style by field value in Leaflet map view
I would like to have different color markers depending on a field value in a Leaflet Map view.
I try to use Replacements Patterns in format > style options > Map Icon:
but I get a "not ...
0
votes
1
answer
65
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 (...
0
votes
1
answer
49
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 ...
0
votes
0
answers
30
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 ...
2
votes
1
answer
478
views
get the value of a drupal token inside a twig code [duplicate]
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
54
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 ...
1
vote
1
answer
81
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
93
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
23
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 ...
0
votes
0
answers
71
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(...
0
votes
0
answers
23
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
267
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
64
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 ...
0
votes
1
answer
103
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
27
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
58
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, ...
0
votes
0
answers
102
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
41
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
30
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
34
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
39
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
263
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 ...
0
votes
0
answers
56
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 ...
0
votes
1
answer
179
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
37
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
19
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 ...
2
votes
0
answers
367
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 ...
0
votes
1
answer
602
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
97
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
43
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
291
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 ...
0
votes
0
answers
38
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 ...
0
votes
1
answer
126
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
39
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
50
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 ...