Questions tagged [views]
The Views module allows creating lists of entities with a flexible query builder.
15,177
questions
1
vote
0
answers
39
views
Find content with missing entity reference
I have nodes that have embedded Media (images) and also links to other content (nodes and media). Through hooks I populate custom fields to store those references, this is a multi-value entity ...
0
votes
1
answer
34
views
Report of coupon and users
I have users who are partners and users who are clients. When clients submit an order, they use a custom coupon code associated with each partner. (Each partner has a Mycodes field set within their ...
1
vote
0
answers
31
views
Filter only by existing nodes
I am trying to get a view to have only a selective range of referenced content, (somewhat like https://www.seek.co.nz Classification filter) in its exposed filter, but not having any joy so far.
This ...
1
vote
0
answers
29
views
Display only the first child of a book
I have a book "continent".
Child are like this :
Continent > Country > State >cities > Street
There are several countries, several states, several cities.
When I visit a State, a ...
0
votes
1
answer
25
views
Override a field in a taxonomy terms view
I have a taxonomy terms view, filtered by a vocabulary. I would like to add the dashes before the term name like in the Parent terms field on the edit term page. The code in TermForm.php does that ...
0
votes
1
answer
25
views
Getting error while importing the fields in Google Analytics Reports module
I have installed Google Analytics Reports module latest version, enabled the GA reports data API and created a service account credentials on developer console. Then I have downloaded the json file of ...
0
votes
1
answer
61
views
How can I overwrite the value of a field in a bundle class?
In Drupal 9 I would like to know if it is possible to overwrite the value of a field in a BundleClass. Looking at the Drupal API, I see that it is common to use either hook_entity_view_alter or ...
0
votes
0
answers
34
views
How do I output an embed of a private file PDF in views
What I am trying to do is embed a pair of PDF files on a page using a View; however because they are uploaded to the private file store I think I am on to a loser.
My preferred desire is to have the ...
0
votes
0
answers
37
views
People view showing some users multiple times and others not at all
I'm seeing some weird behavior in the build-in People view and I'm going to try to explain it.
There are 168 users in my site. If I change the view to show them all (and not paginate), it shows them ...
1
vote
0
answers
100
views
Views: Filter and/or sort by computed field - hook_views_data()
I have created a computed field, using ComputedFieldTrait. It is working fine, I am able to add the computed on the manage layout pages. I have implemented hook_views_data_alter() to tell Views about ...
0
votes
0
answers
16
views
Is it possible for a Views Pager Items Count to count the number of field groupings instead of rows?
We have a View that uses grouped entities displayed using an accordion formatter. Each according "group" has a varying amount of rows in it.
We would like to display 10 groups per page but ...
0
votes
0
answers
24
views
Views posts not displaying correctly until clearing the cache
I have an issue with a Drupal 8 website. I have some pages that have views listing some contents ( text and images). The websites uses CDN and varnish. The problem is that sometimes, the contents like ...
0
votes
0
answers
25
views
search api views, sort by most viewed?
I have a view of content.
I have enabled the statistics module and in the view I can add Sort: Statistics: Total Views.
I am now trying to make a similar view page but using search api.
Have enabled ...
0
votes
0
answers
25
views
How to add "all" option to exposed filter?
I see this discussion for Drupal 7 but am trying to do something similar in Drupal 9.
My view is called "content_display" and the display I am trying to affect is called ct_list (see ...
0
votes
0
answers
15
views
When doing views Rest Export the response has media field where i also want alternate text, how to get them as response
I am getting rest response through views and when i try to get response with field media i also need to get image/media alternate text.I tried to set through relationship for the particular media ...
0
votes
0
answers
15
views
Menu from Views page display using contextual filter taxonomy term
Classified ads site here, Drupal 10.0.7
I have a View page display showing fields from nodes using Taxonomy Term Id as Contextual Filter.
So if the URL reads "[domain]/clasificados/8" it ...
0
votes
0
answers
19
views
Special sorting requirement in views for a multi-value field: how to avoid duplicated result items
This is another attempt to solve Custom views filter plugin: filter over two fields of a custom entity where one of the fields is a multi value field in a seperate table
I have create a basefield (...
1
vote
1
answer
29
views
Image from field not properly displayed in teaser
On Drupal 10 with Olivero theme, I set image in teaser to be displayed with original size.
I also made sure the image field display is enabled in teaser view.
Still, the image is shown on the left of ...
0
votes
0
answers
13
views
Commerce and Views - show all products where there are colours available as different clickable links
I am building a commerce site. I'm trying to create a view where all my products will show with image, title and price. I sell t-shirts in say 3 different colours in 3 different sizes. In the overview ...
0
votes
2
answers
84
views
Change operator in a query?
I'm working in a Drupal 9 website.
I need to change operator in my view query from != to <.
In a view i got two contextuals filters:
The first to retrieve id from an entity reference field.
The ...
0
votes
0
answers
17
views
One taxonomy filtering two fields
I have 2 fields on one node that both read the same taxonomy (Normal features and special features).
Now I want to show only 1 filter in the view that looks in both fields. And with the "Combined ...
0
votes
0
answers
26
views
Show Siblings via Views and taxonomy term in a block (again)
I've got a
D9 site
with an Event content type and a reference to the
place taxonomy term
In the taxonomy term, there is a field zip_code.
The taxonomy terms are setup in a hierachy:
State 1
County ...
0
votes
0
answers
23
views
Leaflet custom marker doesn't work on multiple points
I am using Geofield field with Leaflet module.
I need to customize the marker and I'm having a problem with content types that have more than one point on the map.
While for ctypes that have only one ...
0
votes
0
answers
19
views
Displaying an entity pager in an article if that article is included in an entityqueue
I want to have a pager at the bottom of articles that a user can cycle through, that consists of other articles that are in the same entity queue list that the current article is also inside of.
I'm ...
1
vote
2
answers
92
views
Custom views filter plugin: filter over two fields of a custom entity where one of the fields is a multi value field in a seperate table
I have a custom entity with two basefields of type "list_string": "role" and "additional_role". I need this as "role" is used for sorting the entities by a very ...
0
votes
0
answers
40
views
How to display the output of the View as json in the list of articles which use paragraphs?
I have a content type Article which has a field_paragraph field.
Also I created a Paragraph type: View Paragraph which has a View reference field
When I create an article, in the field_paragraph field ...
2
votes
0
answers
43
views
How to group taxonomy terms by depth in views?
my example taxonomy looks like this:
- fruit
-- apple
-- orange
-- banana
- vegetable
-- carrot
-- cabbage
i want to render a page in views that groups level 1 terms by their parent term, The ...
0
votes
0
answers
22
views
How do I programmatically provide an exposed filter value to a view?
I am validating the creation of a new node in code thus $form['#entity_builders'][] = '_my_node_builder;
In this validation code I would like to check that my_view returns no results when its exposed ...
0
votes
1
answer
121
views
Creating a Custom Content Listing Page based on specific content type or taxonomy terms selected in the node
I am trying to create a content type that generates a list of content/nodes based on other content type or taxonomy terms selected within that node in the content type. I have a general content type ...
0
votes
0
answers
113
views
Trying to sort rows by a column in views twig template
I'm trying to sort the rows of a view in the table template but can't figure out how to sort by a particular column. I can only get it to sort by the first column. I'm trying to sort a views global ...
0
votes
0
answers
36
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 ...
-2
votes
1
answer
53
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 ...
0
votes
0
answers
78
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 ...
0
votes
0
answers
127
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
78
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 ...
0
votes
0
answers
41
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
...
0
votes
1
answer
80
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
15
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
21
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 ...
0
votes
1
answer
222
views
How to add condition via views_query_alter() to filter a multi-value select field 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 "...
0
votes
0
answers
11
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
141
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 ...
2
votes
1
answer
30
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, '...
1
vote
1
answer
399
views
How to remove duplicates in view... the return
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 ...
0
votes
1
answer
107
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
vote
1
answer
176
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
25
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
vote
0
answers
40
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
85
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 ...
1
vote
0
answers
71
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 ...