Questions tagged [views]

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

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

How do I pass a variable to a views-view-fields.html.twig template file programmatically?

I would like to pass a variable (Drupal 9) to a 'views-view-fields--view.html.twig' template file so that in the template file itself I can test whether the variable is defined. I tried using the ...
0
votes
0answers
32 views

How do I add the news that I created earlier to the slideshow using the Paragraphs module?

I created Content type - News. And added ten news. Using the View module, I displayed them on the /news page. I need to make a slideshow with 3 selected news on the frontpage of the site using the ...
-1
votes
1answer
27 views

Read view field value in VBO action [closed]

I have a view grid that has custom actions to perform based on selected grid row. To read the view fields from the grid dpm-ed the below command: dpm($this->view->result); The above command ...
0
votes
1answer
45 views

How to prevend duplicates of content in a view?

On a multilingual drupal website (version 9.2.10) A block duplicates content on the landing page when 2 of more languages are enabled. The block shows random published content for a custom content ...
0
votes
0answers
15 views

drupal view how can i filter results for certain node ids

i have created a view via the gui. I have tried to filter on the nodes i want, either with a normal filter and an or, and adding a few of them in a contextual filter. I face two issues: 1. i cannot ...
0
votes
1answer
16 views

How to use sql MAX() function in views plugin query

I am creating a custom views filter for a custom views field. The following SQL will accomplish the filter I seek: select nid, moderation_state, content_entity_id, MAX(content_entity_revision_id) ...
0
votes
0answers
41 views
+50

Geofield -> Filter points inside a polygon

I have two content types. Each of them has a Geofield field: A -> It has a Geofield of type polygon B -> It has a Geofield of type point I would like to build a view to show all B nodes that are ...
-2
votes
0answers
17 views

How to get form data from database in drupal [closed]

I have created a form and saved it. Not I need to fetched all the fields of table and show those somewhere else.
0
votes
0answers
22 views

How to replace the "Views" pages of taxonomy terms?

I have a site with Drupal 9. I have created a taxonomy and I want to personalize the terms pages. In Drupal there is a "Views" for the taxonomic terms pages created by Drupal. The problem is,...
1
vote
2answers
85 views

How to add class to multiple view-blocks using twig?

I have four blocks to a view. I want to add class 'fancy-body' to all four blocks. How can I add that. view_id : categories display_id's of blocks : block_1, block_2, block_3, block_4 I know, I can ...
-2
votes
0answers
31 views

Variations do not work at all, no documentation how to set it up properly [closed]

It looks like whole commerce core is set up only for 1 variation. Anything I do, I can not set it up properly to make it take at least 2 variations. Add to cart buttons only add first variations in ...
0
votes
0answers
10 views

Filter views by field value equals another field of curent node

D9.3. All fields are not referenced, they are just simple integers. All data was pulled from a huge external API and it was not possible to create all references. Just for ease of understanding, ...
-1
votes
0answers
25 views

Why are news not filtered by date?

Task: I need to filter news by category and news creation date. Filtering by category was easily implemented: In Edit View -> FILTER CRITERIA -> Content: Has taxonomy term But news is not ...
0
votes
0answers
19 views

How do I dynamically add filters?

I have a view_block with the following filters, I want to change the product tag, Release tag, Document type values dynamically based on url. if the url is, example.com/mars/21.43.00/ProductGuide, ...
0
votes
0answers
24 views

Load view form with ajax missing ajax functionality

When clicking an element I get a form which is generated by a view (using https://www.drupal.org/project/editablefields module). The problem is that the ajax functionality of the form is lost (no ajax-...
0
votes
0answers
22 views

How to add contextual filter?

I am working with books in drupal 8. I want to display a specific page("table of contenets") on the sidebar whenever any page of that book is accessed. "table of contents" is a ...
-1
votes
2answers
29 views

How to add view filter programmatically using hook_views_pre_view()

I want to add a simple filter to an existing view in Drupal 9. It appears that I can achieve this with hook_views_pre_view(). In every example I can find, including all the "Similar questions&...
0
votes
0answers
13 views

Views: count flaggings per entity-referenced node

I have a flag called Collect. (Flag is individual, and enabled on multiple content types.) The flag has an entity reference field to a content type called Bucket. When users flag nodes, they go to a ...
0
votes
0answers
13 views

Export data with one thousand values in contextual filter

I have a view (views data export) that I need to pass approximately 1000 values for a the contextual filter. I need to get the view results for certain 1000 node ids. Via the GUI it allows me only a ...
0
votes
2answers
22 views

Display a pager on the top and bottom of view pages but only on the bottom of view blocks

For a project running on Drupal 9.2.9, I want pagers on the top and bottom of view pages. I have it working on pages by an edit to a custom views-view.html.twig in the theme (using the full pager ...
0
votes
0answers
10 views

view and context variables does not get passed on VBO custom execute action

I have created a custom VBO action and below is my code for the customaction.php. The action is getting created perfectly fine, however the $view and $context variables are not getting passed through. ...
0
votes
1answer
32 views

Plugin not found

I am overwriting the CommentBulkForm class in my module. namespace Drupal\mymod\Plugin\views\field; use Drupal\comment\Plugin\views\field\CommentBulkForm; /** * Defines a custom comment operations ...
1
vote
0answers
23 views

Filter GeoJSON feed on a value in the path

I have GeoJSON feed, created with a view in Drupal 7, that I want to filter on a path value in the url of the loaded page (/path/%). The feed is loaded as an Openlayers map on a page. The feed seem to ...
0
votes
1answer
17 views

How to stop duplicates caused by date range in views

On my site I have a content type called Course. Courses can have several sessions. To display these sessions I am using the date range. When a course has more than one date range entered an instance ...
0
votes
0answers
11 views

create views filter from sql

I've been trying to create a view that gets all nodes that are in moderated "draft" state as created by the group content moderation module. The current views content state filter will not ...
0
votes
1answer
28 views

Overwrite a specific VBO action processed message

I am using VBO to perform bulk operations on my view. I have 2 core VBO actions and 2 custom actions. Publish comment Unpublish comment Publish resource Unpublish resource When the Apply action ...
1
vote
1answer
71 views

Can I choose specific nodes to show in a view?

I have a Drupal 9 site with a view that shows products, but I do not want to show all products, I only want to show a select few of them. Is it possible to filter like this? Instead of showing all the ...
-2
votes
0answers
18 views

What's the best way to create summary reports?

I have a running site with extra fields that track attributes of the user. That is, field A might be filled with 1,3,4 or 3,5,7. And field B might have alpha, gamma, omega for one user but beta, ...
0
votes
1answer
19 views

Toggle view displays on the same page

There are 2 view displays (2 blocks) which are showing products, one with tile display, one with list display, as shown in the image below. Is there a way to have both blocks on the same page, but ...
0
votes
1answer
34 views

Views: Put the extra condition in the ON clause for the query

I want to put extra ON condition SELECT * FROM users_field_data t1 LEFT JOIN node_field_data t2 ON t1.uid = t2.uid AND t2.type = 'article' and t2.created > 1630491519 WHERE t2.uid is null; using ...
0
votes
1answer
19 views

How to keep Contextual Filters (query) on Exposed Filter change

I have a view page that leverages Contextual Filters with query parameters. So when a user visits the view page, the URL is as such… /search?location=san+francisco. This works as expected. Now there ...
0
votes
0answers
49 views

The "node" parameter was not converted for the path "/node/{node}"

I have the following error in the filters with parameters in view type pages. will there be any solution to this problem? Drupal\Core\ParamConverter\ParamNotConvertedException: The "node" ...
1
vote
0answers
16 views

How to display all data from a paragraph field in views (Drupal 7)

I am currently a caretaker for a Drupal 7 website and I can't figure out how to group paragraph items in views. I have created a content type Products and one of the fields is called product variation ...
0
votes
0answers
7 views

Drupal7 Views relationship multi value custom column

Im using Drupal7 and views, views relationship Im displaying the results in table format with the help of view along with other custom tables as well as by using views relationship. I need a help in ...
0
votes
0answers
28 views

View injecting weird html elements (b element)

I've noticed recently that, in a drupal website I'm maintaining, a view displaying a list of content type called Event, has some weird html elements injected. This messed up the layout and I'm not ...
0
votes
1answer
32 views

How can one programmatically get the bundle constraint for an entity reference field?

I'm working in the context of a Views plugin. I have $entity_type and $field, as required in the snippet below. How can I get the bundle constraint for the entity reference field programmatically? /** ...
2
votes
1answer
40 views

How to create a view that lists all taxonomy terms of a vocabulary, filtered by a term id?

I have a lot of different vocabularies. On The taxonomy page (the standard view provided) I would like to add a block (view) that takes the current taxonomy id from the url/page and displays all ...
-2
votes
1answer
26 views

Column isn't responsive [closed]

I have inserted a view and one column refuses to word wrap on mobile display. On normal desktop display it wraps just fine. But as seen in the second image taken on my phone, it puts everything in ...
0
votes
1answer
23 views

How to pass Paragraph ID from Layout Builder to Views?

This is a bit convoluted; so hopefully it makes sense: I have a parent entity: Event. Event has a Paragraph field on it: Sessions (paragraph type: Session). I use Layout Builder to format the Full ...
0
votes
1answer
33 views

Similar content with contextual filter by url [duplicate]

There are two types of content (as an example): fruits vegetables They share the same vocabulary and similar terms. Catalog structure: -Fruits --juices ---for children ---for men ---for women -...
1
vote
1answer
32 views

Get raw node id value in views template without errors

I need to get the raw node id value in a views template, but the debug comments are interfering. Based on this issue I am using the following: {{ row.columns.nid |render|striptags|trim }} Which ...
2
votes
0answers
18 views

How use subqueues of entityqueue module?

I'm on D9 and already using entityqueue module to let the content editors orders some views via "simple" queues Now, I've been requested to make possible to order the nodes appearing on the ...
0
votes
1answer
29 views

Experiencing problems filtering view programmatically

I'm using a views block in my website, the content of this view is filtered programmatically. I now get messages from users who see the wrong information. The filter is based on the currently logged ...
0
votes
1answer
19 views

Create a block with related content selected from "page" content type

I've two content-types: 'Page' and 'Bike' From the page, I use a Entity reference field 'field_kies_je_leasefiets', where I link to several bikes. I want to create a block, placed on the full node ...
0
votes
0answers
18 views

Read reverse-relationship from a view programatically

Alright, this is taking so much time than expected. I'm having a comment type "Default comment". The comments under this comment type is published and created as nodes under "level3&...
0
votes
1answer
17 views

Read entity reference node field

I have a referenced entity named - field_cp_level2_ref_level3. This field belongs to level3 content type. when I dump the $entity, I see the field as below: entity:node:level3::...
1
vote
1answer
28 views

How to display an SVG code in a Views?

​ I added the following code for a "Global: Custom Text" field of a Views : <div class="messages-list__item messages messages--warning" data-drupal-selector="messages" ...
0
votes
1answer
24 views

How to change the condition to AND in accessing content by role in a view-block?

I have a view-block 'Expo', I want to display this block only if current user has two specific user roles i.e., 'Actor' and 'Singer'. When I checked the both 'Actor' and 'Singer' , The block is ...
0
votes
0answers
46 views

Save textarea word count programmatically

I'm trying to keep a word count tally on a set of long text fields. As far as I can see, there are several options: Create a view and add php to a custom template that produces the word count. Most ...
0
votes
0answers
7 views

Use Views Rules to loop over a user's view

I have a contextual view that lists the last expired Course Session of a teacher. I use a contextual filter like this: User: Uid whereby: WHEN THE FILTER VALUE IS NOT AVAILABLE Provide default value ...

1
2 3 4 5
298