Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

Trying to sort a views result by a global views conditional field

I'm attempting to use hook_views_pre_render in a Drupal 8.9.20 site to sort the results of a view by a global views conditional field and I could really use some help. I've spent some hours searching ...
  • 1
-2 votes
1 answer
32 views

Set the canonical link rel via theme's template.php for a specific views page (not a node)

I do not want to use the D7 Metatag or the MetaTag Quick modules. How can I specify a single canonical link rel for a single URL which is not a node (a view page) via the theme's template.php? I've ...
  • 1
-1 votes
0 answers
7 views

End User page to place orders (i.e. Product display)

Team and contributors, I am a long time Ubercart user and am accustomed to building a View to display products for purchase with attributes and options (and adjustments.) It seems that UC is now kind ...
0 votes
0 answers
13 views

Access a Computed Field in Views

I am trying to get the new version of Computed Fields to work on our site. It's working great, except I can't get it to be accessed in Views a field. In the README it explains that the new version has ...
  • 93
0 votes
0 answers
36 views

Customize search results page

Is there a specific way to customize the search results page in Drupal 10? I would like to change the look of how the results are displayed. I have used Views to create the look how list items but I ...
0 votes
1 answer
28 views

Using views_query_alter() hook to dynamically add a OR "where" to a Search API View?

We have a Search API View that we need to dynamically include results to the query that where filtered out. The use case is that the Search Index View shows a filtered list of node but we have a ...
  • 1,103
0 votes
0 answers
20 views

How to show content / blocks in views for path component 3, 2 OR 1?

The taxonomy contains mostly 3 levels, sometimes two levels only. Parent Child 1 Grandchild 1 Child 2 Via path alias, the patterns create URLs like: /parent/child1/grandchild1 /parent/child2 ...
  • 277
0 votes
1 answer
25 views

trigger('RefreshView') problems with pagination

Colleagues, can you please advise: there is a views with enabled ajax and pagination, there is a form on the page (also ajax, but not views), which makes changes to the displayed views values. To ...
0 votes
1 answer
13 views

Displaying all pages in a BOOK teaser block within a block

I'm trying to display all the BOOKS in my site as a teaser block with the pages below it. Like this: Title: This is the book of my Cat Page: 1 2 3 4 5 6 7 8 Title: This is the book of my Dog Page: 1 ...
0 votes
1 answer
15 views

Display the last page in a BOOK content type as a link?

I'm currently using the core BOOK content type as a form of discussions. I created a views page with all the books and titles exposed. But I also want to append the last page of the book in the Views ...
1 vote
1 answer
37 views

How to add condition via views_query_alter() that does not contain a value?

I have _views_query_alter() hook that I need to filter out nodes whose multi-value select does not contain a value ("National"). The code below works to show the nodes that do contain "...
  • 1,103
0 votes
0 answers
6 views

Why might a panel pane print a block as class="panel-pane pane-block..." vs class="block block--views..."?

I apologize if the wording for this question title does little to explain my problem. I'm so deep into not understanding an issue I'm having trouble describing it. To preface, I'm quite a noob with ...
0 votes
1 answer
58 views

if statements in fields template

I am trying to display a field using the following code, but it does not work. {% if fields.field_apply_now_url %} <a class="btn common-btn-blue" href={{fields.field_apply_now_url....
0 votes
1 answer
21 views

How to alter pagination url of embedded view programmatically?

I m trying to send mail which contain some data along with embedded view result programmatically. This mail is trigger on submit of webform. Webform ajax property is enable. Due to which it send ...
  • 71
1 vote
1 answer
22 views

is it possible to make use of data stored using the user.data service ifor filtering views?

Allowing a user to bookmark a node i have created public function bookmark($nid,$uid) { $user_data = \Drupal::service('user.data'); $bookmarked_nodes = $user_data->get('my_module', $uid, '...
  • 3,109
0 votes
1 answer
104 views

How to remove duplicates in view using hook_views_query_alter

I know that this question turn around in Drupal answers but I couldn't get a working answer for my use case. Here it is: I have a view which is producing duplicate results (and I understand why) but I ...
  • 438
0 votes
1 answer
30 views

How to have Views Attachment show all results of View, including the ones on the next pager pages

We have a Drupal 9 View using a GeoField Map to display the results using an attachment. The problem is that we want the map to show all the results, not just the ones on the first page. Currently, we ...
  • 1,103
0 votes
0 answers
21 views

Adding template suggestions for a view with display ID

I need to have suggestions for views to create dedicated template. Actually I've this in my .theme: function starter_d9_2022_theme_suggestions_views_view_alter(array &$suggestions, array $...
-1 votes
1 answer
22 views

Orders view personalization

Apache 2.4.29 + php8.1 + mySQL 5.7.41 Drupal 9.5.3 Commerce 8.x-2.33 Hi all folks ! I'm trying to personalize the orders view with custumer's name, adress, ... To do that i add the "commande"...
  • 1
1 vote
0 answers
31 views

Subtotals with group by

I have a view which groups content by date and each row has a field with a numeric value (the worked field in the screenshot below). At the end of each group I would like to display the sum total of ...
0 votes
0 answers
16 views

Grouped date filter with multiple selections

I have a view with an exposed filter on a date field. It's a grouped filter by year using the module views_year_filter. All works as long as I don't enable allow multiple selections. When I enable it ...
  • 465
1 vote
0 answers
27 views

How to subscribe to a view render event?

I'm writing a module that will inject javascript into the page when a view is rendered. The contents of the javascript will depend on the results returned in the view, so ideally I would have access ...
-2 votes
1 answer
34 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/...
  • 1,221
0 votes
0 answers
17 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 ...
  • 21
0 votes
2 answers
24 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 "...
  • 101
0 votes
1 answer
30 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
31 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 ...
  • 19
1 vote
0 answers
37 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 ...
  • 579
0 votes
0 answers
14 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
20 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 ...
  • 1,221
0 votes
1 answer
42 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: ...
  • 1,008
2 votes
1 answer
38 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
40 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
87 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
45 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
16 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
25 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 ...
  • 161
0 votes
1 answer
25 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,103
0 votes
1 answer
41 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,052
0 votes
0 answers
24 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
78 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
44 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 ...
  • 21
0 votes
1 answer
28 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
29 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 ...
  • 545
0 votes
0 answers
30 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,765
0 votes
0 answers
21 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
92 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
30 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
46 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
2 3 4 5
303