Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [views]

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

0
votes
0answers
11 views

in my view user count field not displaying properly to site members, but displaying properly to admin

I have tried to achieve total og group members count and users count in a view. detail and complete information on this link user count and posts count in a og view in my case in above link comment ...
0
votes
1answer
69 views

Rewriting image output in views: how to provide replacement pattern inside twig tag?

In views I want to rewrite output of image field by using twig function drupal_image (see module Twig Tweak). When I provide the image path directly, this code works: {{ drupal_image('public://...
0
votes
1answer
62 views

Programmatically get the results of a view

Using the group module in D8, I have the below view with machine name: group_members_per_group Machine Name of: (Member account) User: Full Name is: field_user_full_name (Member account) User: ...
0
votes
0answers
9 views

Is it possible to use hook_views_query_alter to compare the value of two fields?

We have a D8 site with a view that links a Content-->Paragraph-->Content. We also have language translation enabled so the views_ui module displays duplicate rows for all combinations for the content ...
0
votes
0answers
18 views

Views : Contextual filter on reference?

I can filter the View by using Contextual filter on a normal field, but when the Ctx-filter is set to use Reference field the filtering does not work. F.e. let say I have two content types A and B, ...
0
votes
0answers
17 views

Add a custom button to a views exposed filter form

I'd like to add a custom button near the "apply" button on a view exposed filter form. To do that I have created my own module and added a hook: function mymodule_form_views_exposed_form_alter(&$...
0
votes
1answer
87 views

Alter views exposed form

I have a view that in that view I set up 3 exposed filter, all working fine. I need to set a condition to show the third filter option to a specific user, it can be checked according to the user role, ...
0
votes
0answers
8 views

How to ignore (or clear) invalid views filter value?

We have a scenario where there are some dead links out in the world to our calendar. Because the page exists, it won't result in a 404. However, some of the URL parameters are old filter values which ...
1
vote
1answer
52 views

Output Paragraph values instead of the Paragraph IDs in a View REST export?

I have a View with a REST export display (image attached) that has some indexed field values from Search API. The highlighted portion, authors, is a Paragraph field. Instead of the entity ID pointing ...
0
votes
1answer
31 views

Twig: Generate classname from variable in views template

In the twig template file of a view with grouped rows I would like to add the title of the group as a classname. But the rendered classname from title variable is just "_" on every group. This is the ...
0
votes
0answers
14 views

Filter out refunded orders / payments in Views with Drupal Comerce 2

I'm running Drupal Commerce 8.x-2.13 with Commerce Stripe 8.x-1.0-rc2 as payment gateway on Drupal 8.6.15. I have several views where I list all the order items for each product with some fields from ...
0
votes
1answer
30 views

How to include exposed filter name in views data feed export CSV title?

Trying to get views data export to save file with selected token from exposed filter In the settings I can see this explanation: %exposed == effective exposed filters, like filter1_foo-filter2_bar ...
1
vote
0answers
29 views

Views: exposed filters for entity reference, do an AND?

I have a View that has exposed filters that searches and returns results for one content type. I have a few entity reference fields (some content, some taxonomy) that when a user selects multiple ...
0
votes
1answer
34 views

Output data of different content types in same page

I have two content types : Content type 1 named book with two fields author and language Content type 2 named movie with two fields date and resolution In my-theme/templates/page.html.twig I want to ...
0
votes
0answers
20 views

View presents fewer items per page after using Unset

I'm deleting items by means of an unset in hook_views_post_execute, as far as the view I have it configured by 10 items per page. The problem is that it shows me sometimes 6 or 8, I have searched for ...
0
votes
0answers
17 views

How to make a field sortable?

I have a table of data with column headers - currently, some of them have the sorting option, but not all. I'm trying to make one of columns fields have the sorting option, but when I go to table ...
0
votes
0answers
19 views

How can I get field definition values in a hook_views_query_alter?

This is a little related to my earlier question, I'm using a hook_views_query_alter to only show results for the latest (last) value in a list field, and then also in that set only show the results ...
0
votes
0answers
28 views

How can I limit views results based on the value of two fields?

I may have to do this programmatically, but I was wondering if there's another way in the UI. Basically, I have a list of articles with Volume and Issue fields. I want the view to only show articles ...
3
votes
2answers
77 views

I broke a view and i'm not sure how to fix it

I broke a view by adding the "flagged" relationship to the view, then filtering by the flag_id, then deciding against it and removing the relationship. The filter for flag_id was not removed when the ...
0
votes
0answers
24 views

How to create a copy of ResultRow without reference?

I need to have different values in each row based on the same row, so I create $this_row from $row. But field_x contains the same value in rendered view. I guess the $row reference is the same and I ...
0
votes
1answer
24 views

Remove Filter When Exposed Filter is Selected

Currently, I'm working on an events view in Drupal 8 which needs to only show events that are on or after the current date (now() filter). This view also has an exposed date range filter that allows ...
1
vote
0answers
23 views

Views alter query, add condition doesn't work

I have a taxonomy with 2 level of depth and I have a view that get some documents. In this view I can filter by the type of document (get from the taxonomy) but only by the first level. The problem ...
0
votes
1answer
27 views

May I know the difference between field_data_body and field_revision_body?

As I am a beginner of this Drupal 7 I have some doubts regarding these database tables.I need a short notes regarding all these database tables.The doubt which I had found is that when I add the ...
0
votes
2answers
41 views

Change html tag in template file tpl

I have this template file for a view: views-view--ir-news--page.tpl.php But right now, I need to use Google AMP only for this view (Machine name: ir_news) What I want to know is if something like ...
0
votes
0answers
10 views

Views dependent filter not working correctly

I am using views dependent filter to apply multiple dependent filters in my view. The view is a simple listing page. I have multiple categories and set of different filters that will be grouped and ...
1
vote
0answers
15 views

Rule that sends one email out at specific time each day with view content in it

I have 5 different views that show different metrics within blocks on the front of my website. I want a rule that can send this information to me by email each day at a certain time. How do I do this, ...
0
votes
1answer
17 views

Get node form inside preprocess_views_view_fields()

how can I get the node id through the : preprocess_views_view_fields()
1
vote
1answer
15 views

How to change image style using hook_views_pre_render()

I am trying to adapt the following Drupal 7 code to Drupal 8, in order to set a different image style to every image in a view: // Assigns a random style name to each image function <MODULE_NAME&...
0
votes
1answer
26 views

Contextually filtering a view using values from a completely separate table?

I have a table "user_connections" id | uid1 | uid2 1 | 1 | 2 2 | 3 | 1 etc So, if the current user has uid = 1, then according to my table, he is "connected" to use 2 and 3. So I just want ...
1
vote
1answer
14 views

Display a view block with a list of content excluding the one currently displayed on the page

I sometimes use contextual filters to display fields matching the content ID from url In that case , i would like to display a list of content as a view block , except the one that is displayed It ...
0
votes
1answer
41 views

Creating a “tag blacklist” for users on a view

I'm looking to allow users to create a "blacklist" of certain tags on a site. My plan was to do this through adding a "Blacklisted Tags" field on the user entity, but I'm open to other solutions. If ...
0
votes
1answer
43 views

Add an anchor to the redirect URL

I have a website with some news. I create a view that shows them and filter by category. When I use the filter, it reloads the page and goes at the top of the page. I want it doesn't move on the top ...
2
votes
1answer
48 views

How to disable views pager programatically in certain cases

I have a paragraph which shows a view. The editor may set some options as argument filters, sort and show/hide pager. "Normal" fields are used to collect these options and ...
0
votes
1answer
24 views

Multiple path aliases based on taxonomy term

I have taxonomy terms from A-Z and each article can belong to multiple terms. for an example, when I create a new article, I have a multi select list for terms. Therefore a particular node should ...
0
votes
0answers
23 views

Link entire teaser views row to content with core or contributed module?

When creating views I prefer use views modes rather than fields. I have been reading up on accessibility stuff and one topic that comes up is that adjacent fields, linking to the same url can be a ...
0
votes
0answers
22 views

How can I add the entityconnect's add new button to a view

Im hoping someone can assist me as I'm starting to learn Drupal 8. I have a relationship between an Artist content type (Parent) and Album content type (Child), and I have a view set up that displays ...
1
vote
1answer
32 views

How to pass contextual id value from one view page to another through Drupal menuing system

I use a view to display a list of books. The view has three pages: /books/title, /books/date, and /books/popularity. The pages are essentially the same with different sort criteria. The pages use a ...
1
vote
1answer
31 views

View filter based in text not in number

I have a field in an entity that is an Entity Reference with widget Select list. I have created a view and I want to be able to filter by that field in text format, but when I try to configure the ...
0
votes
1answer
28 views

Change content of views_field_view field using hook_views_pre_render

I am using the views_view_field module for embedding a view inside another view. I want to concatenate some text with that field in hook_views_pre_render based on a condition. But when I printed the ...
0
votes
1answer
20 views

Select the same number of results for every group

I have views where I select nodes and group all results in 3 groups by field. When I select for example a limit to 30 I get results but with the different count in every group (for example 20/7/3). ...
0
votes
2answers
36 views

How can I use month name as contextual filter?

I have a contextual filter to filter by month: Date in the form of MM (01 - 12). However, I want to filter by month name (january, february, march, etc.) to get nicer URL and breadcrumb. Is there ...
0
votes
1answer
41 views

How to extend ArgumentPluginBase and have it recognized by Views?

I'm wanting to create a Views argument plugin that extends ArgumentPluginBase in order to overrides one of the form elements in the buildOptionsForm(). I've pasted my plugin below. However, it doesn't ...
1
vote
0answers
16 views

Views Table with Aggregation, total values counted per option

I'm setting up a view of event registrations. Each registration will be allocated to 1 of 3 workshops at two different times in the day. I'm looking to output the total number of allocations per ...
0
votes
1answer
46 views

How to chart data stored in a database table (dynamically) in Drupal 8?

I found these instructions for using the Charts module to display data from a database for Drupal 7: https://www.drupal.org/docs/8/modules/charts/charts-howtos/chart-some-data-stored-in-a-database-...
0
votes
0answers
31 views

Programmatically Importing Nodes from one page to another another

I want to import node that are on one page to another programmatically. Have tried to do by two method $my_view_name = 'view name'; $my_display_name = 'display name'; $my_view = views_get_view($...
0
votes
1answer
32 views

Show terms in view filtered from another view

I have two views, first one is block, second one is page. I have vocabulary, let's call it "food". In the food vocabulary we have that hierarchy: Fruit Apple Banana Meat Chicken Pork Both views ...
-1
votes
1answer
55 views

How to rewrite the field of a view with Twig

I created a view with the machine name cgv_product. This view contains the fields "Product Name" and "Custom Text". In the "Custom Text" field, the {{ name }} Twig code is available to display the ...
5
votes
0answers
60 views

After implementing hook_node_access, how to stop node from appearing in view?

In Drupal 8, I implemented a hook_node_access function in my module to control access for a certain role under certain conditions and it works fine. However, all of that content type are still shown ...
0
votes
0answers
17 views

Slideshow: Cgi Generic Command execution (time-based)

One of our customers received a notice from his PCI scan vendor that the requests in the MD_Slider module used by Views are not sanitized. The latest version is two years old and it could be correct. ...
0
votes
0answers
19 views

Why does a views exposed filter reset an existing contextual filter to 'all'?

I have a view with a contextual filter based on the URL mydomain.com/content/%nodetype And I have an exposed filter block which filters this view by taxonomy term. However, when I am at the page ...