Questions tagged [views]

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

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

How do I avoid a link is closed within a custom text field too soon

I am creating a custom View for my Search API results page. I have many fields added and they are all set to hidden. This allows me to have a custom text field at the end that can have a unique layout....
0
votes
1answer
19 views

D7 block view to only show child nodes based on taxonomy

Using Drupal 7 I have a hierarchical taxonomy each node in the site is assigned a taxonomy to identify where it sits in the site structure. On certain pages (landing pages) I would like to show the ...
0
votes
1answer
33 views

Can't set arguments to a view for displaying all data

I use $view = views_embed_view('export_emargement','page_1',$journee,$region,$produit); it works well, but If I don't want to specify $region the view does'nt works. Im my view admin if I set ...
1
vote
2answers
30 views

How to get my custom module to recognized a exported view?

I have created a view and then exported it normally to a yml file. Then I put this yml file into my mycustommodule/config/install folder. So current its named mycustommodule.view.user_assigned.yml ...
0
votes
2answers
43 views

Filter taxonomy term attached to user field

I have a user that has a taxonomy vocabulary attached their account and a content type with the same taxonomy vocabulary attached to it. How do I get a page view filter to only display the nodes that ...
0
votes
0answers
19 views

Taxonomy terms not localized in view with enabled aggregation

On a view on content, I added a field "All taxonomy terms" (Display all taxonomy terms associated with a node from specified vocabularies) and enabled aggregation, see screenshot of view attached. ...
0
votes
0answers
39 views

How to get translated term name from TID in views field template?

For a complex view, I need to alter the output of a localized term field: instead of putting out the TID of the term, I would like to render the localized term name. Does someone know how to alter the ...
0
votes
0answers
29 views

Replacing a specific content creation with the newest version

I'm creating a website that tracks users weight. A user can create content to enter their weight and I have a view that displays all entries of a users weight however I want it so that if a user makes ...
0
votes
0answers
19 views

Filter content moderation view according to user roles that I currently login to the site

The view I try to filter is only accessible to authenticated users and they have defined roles, that is, it is an administration view. I have several types of content and I want to show in the ...
0
votes
1answer
98 views

Adding a custom data-attribute to a field in Views

In a view I need to add a custom data-attribute to the row output (just like classes are added). Simply rewriting the output doesn't work because XSS attribute filtering strips the attribute. How can ...
0
votes
2answers
22 views

Create a view on a entity using criteria on another entity

I'm trying to this done : I have two entities 1) Listing Details 2) Listing Premium Settings. This entity references the first Listing Details entity. In the second Entity I have referenced entity ...
0
votes
2answers
73 views

Getting a view of unique years of a date field

I'm tasked with creating a Year filter for our press releases page. We're using the Article content type, to which we've added a field called Release Date. We have the press releases as a block ...
-1
votes
0answers
13 views

in my view user count field not displaying properly to site members, but displaying properly to admin [on hold]

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
86 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
278 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
13 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
62 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
474 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
11 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
117 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
36 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
15 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
33 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
30 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
26 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
29 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
90 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
26 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
28 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
31 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
57 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
14 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
18 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
26 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
30 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
19 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
42 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
56 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
84 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
29 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
38 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 ...