Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
27 views

How to list entities and sort them by delta?

I have a "stations" and "railways" node types and a custom "notification" entity type. In "railways" node type I have an entity reference field ("...
0
votes
1answer
15 views

How can I show related terms in the same list with related nodes in taxonomy term page?

I need to show sorted listing of both related nodes and related terms in a taxonomy term page. Can it be done with views or does it take a custom module?
0
votes
0answers
13 views

How to remove text from the body field in views and leave only <img> tag?

Good evening, i have articles that contain texts and images, i would like to know if there is any way in views to strip or remove the text from body field leaving just the img tag, i don´t want to use ...
-2
votes
0answers
31 views

Adding a for loop

I would need a small help to get the output by adding the for loop. I have a view which has a image field. And I would like to theme it, I have created two view templates called "views-view-list--...
-1
votes
0answers
17 views

Custom Slider Programmatically [closed]

I am new on drupal and working with drupal-8. currently, I start working on custom module. I want to make a custom slider programmatically for my practice. but I don't know how should I start. I ...
0
votes
0answers
13 views

How do I programmatically disable the pager?

I'm using a view with infinite scroll. I want to disable the pager for the default view and keep the pager if we select some options from filters. Can we do it via code?
2
votes
0answers
57 views

When use node_view cache tag?

When should we use the cache tag node_view? I guess it is a core cache tag? When does it get invalidated? $build['#cache'] = ['tags' => [ 'node_view', // ... ]]; Update Like user_view and ...
1
vote
0answers
14 views

How do add row striping CSS classes in Views?

I'm sure that on older versions of Drupal (6 or 7?) Views that showed as tables automatically had odd/even striping background colours. Is there a UI option for this in D8/9? I've done it in code like ...
-1
votes
0answers
28 views

I am trying to display the anchor tag link text issue [closed]

In Drupal 8, I am trying to display the entire text in the anchor tag. But it is truncating to 79 characters. How to display it fully. Example: <a class="btn btn-info" href='#someurl'>...
-2
votes
1answer
33 views

Is there a way to sort view asc or desc using twig

Is there a way to sort view asc or desc using drupal_view('vn', 'vmn', sort order) in twig or Can sort we views_embed_view() in controller
0
votes
1answer
27 views

How to put view results in an entity reference field?

So the scenario is like this: I have to create a "node" which has an entity reference field which can hold multiple values. I am looking for a way to be able to select view results to be ...
0
votes
0answers
18 views

How can I use range filters for strings?

I have created a view in Drupal 7 in which the dates are in text format, eg 2020-10-12 and I want to filter date ranges using between or >= and < but there doesn't seem to be such an option for ...
0
votes
0answers
17 views

Rendering view better expose filter in drupal does not containg term id in drupal 8

I have created a view with better expose with term taxonomy And render in twig file Drupap_view('viewname','machinemname') Now I want use contextual filter based on term id dynamically But I see ...
0
votes
0answers
14 views

How can I override better better exposed filters result using a custom Ajax request?

I want to override the result of Better expose filter using custom ajax call. Because I am using multiple better expose filter with auto submit but i want to show the result of single item. I write a ...
1
vote
0answers
14 views

Adding a “Like” operator via views query alter for taxonomy term name

I am trying to add a "Like" operator via views query alter for my taxonomy term name. My view is a block setup with a contextual filter set to show all results as shown below as I want to ...
-1
votes
0answers
16 views

Choose location on a map and add to webform submission details

We'd like to be able to allow a user to pin point a location on a map and then be able store that information with lat and long in a webform submission. I've looked into the add on's on webform drupal ...
0
votes
1answer
14 views

How do I set filters to reset automatically on new search?

I have a search and some filters on a drupal 7 site. If I search a term, for example "stuff", and there are 30 results, I can click a checkbox filter (let's call it FilterA) on the side and ...
0
votes
1answer
18 views

How to filter content by a specific taxonomy term when vocabulary allows multiple values?

I have defined a vocabulary that allows multiple terms to be checked for a Content Type and I would like to create a View that could gather all the data from that Content Type but grouping the results ...
0
votes
2answers
33 views

How to filter my view of Groups to show results matching Term A or Term B

I am adding taxonomy terms to groups (using the group module) and want to use the terms to filter groups within a view. However, my exposed filters don't seem to work. There is no error, but the ...
0
votes
1answer
39 views

Where are the field formatter settings?

When I'm managing a display for an entity and select a field formatter, some formatters have options available (see screenshot 1). However, when I use that same field formatter in Views, there's no ...
1
vote
3answers
61 views

How can I override the markup of a view I printed in a template file?

I installed the Twig Tweak module on my site to render Views on the home page. I want to make the display mode frontpage_tasks for the current user, his account, his stores and his groups. {{ ...
-1
votes
0answers
14 views

Show result of current selected value in drupal 8 better expose filter used multiple filter

I want to pass only the current selected value/ want result of current selected value even if there previous selected value in Better expose filter. I have taxonomy term with multiple term that I ...
0
votes
1answer
15 views

View Taxonomy Term List with Exposed Has taxonomy terms (with depth) filter

I have view list of terms of a vocabulary. The terms of it have an entity reference field of another vocabulary (with hierarchically organized terms). I would like to filter the terms by that entity ...
1
vote
1answer
14 views

View based on months or days - display certain items during specified times of the year

I am trying to create a calendar-type view that will display links to specific nodes during certain months of the year. For example, this would show 'Taxes' in Feb and April, 'Travel' from May to ...
0
votes
0answers
13 views

View to get information for the user entity reference using contextual filters

I have two content types and each one has a user entity reference field. I want a view using contextual filter that shows the information of the content types when I pass the user ID referenced for ...
0
votes
0answers
8 views

How do I set a grouped exposed filter of boolean fields in a view?

I have a view with fields used as filters and exposed to user in a dropdown. They are "grouped" in the filter section. These fields are boolean. I can't get them to work together. It's ...
1
vote
1answer
36 views

How do I add a view between display fields of a node?

I have a view that displays a table at the bottom of every node. It's part of the content of the node so I want to have the "comments" section below the view. However, the comments are a ...
1
vote
1answer
30 views

Exposed date filter against >= “today” fails until 5pm Mountain time

I added a Date only date field named expires to the user profile. The expires field has the value 2021-01-08 for a certain user (I checked the database; it has no time component). In a view, I have an ...
0
votes
0answers
11 views

Previous week is calculated wrongly in Views

I have a view with 1 contextual filter. This filter using a field of type: Date. Configuration of this contextual filter: When the filter value is NOT available: Provide default value -> Current ...
0
votes
0answers
11 views

How to add a password reset link in the “Administration Views”

The administration views on drupal 7 https://www.drupal.org/project/admin_views replaces user page with a new views. I would like add a password reset link which would send a password reset email to ...
1
vote
0answers
11 views

Change the output format used from a view export

I have a REST EXPORT view with particular fields in Drupal 8. I want to remove the main array which is printing by default. The response is coming like this. [ { "title": "Product&...
0
votes
1answer
14 views

How can I get the Operations Link Field back?

I have a custom entity created in code which displays list in collection route. I decided to use a view to show this collection. I created a new view of type 'Product' (Views shows my custom entity) ...
-2
votes
0answers
18 views

issue with upcoming events date

Facing issues with date, I want to show the same event date in the red box and you can see the event date is mentioned below the location. Instead of showing the event date, the current date is ...
0
votes
0answers
85 views
+50

Is there a way to apply cached access results to listings?

Code that is put in either hook_entity_access or an access handler has no effect on listings such as views field displays and search. I am not sure if this is by design or due to an error from my side,...
0
votes
1answer
23 views

How do I display the content type's description in a view's header?

I have a view that lists nodes of a single content type, where the content type is given as contextual filter. I'd like to add the name of the content type and a description to the header, for example ...
0
votes
0answers
48 views

Is there a way to create a report view of all links (<a /> tag) contained within all published content?

Is there a way to create a report view of links contained within all Page nodes of my Drupal site? We want a list of all hard-coded URLs (href="https://example.com/example/example") but don'...
0
votes
0answers
14 views

Admin URL path in commerce shipping view?

I am setting up a Shop with Drupal Commerce 2 currently. I installed the Commerce Shipping Module and customized everything to my needs. The only thing I wonder about is, that the URL for the default ...
0
votes
1answer
47 views

Entity Reference returns blank content

I thought that omitting code and being more graphic was going to improve the question, but that only made it score negative hehehe. So I'm going to put in some code to make it look clearer. Here is ...
0
votes
1answer
29 views

How can I achieve this functionality?

I am a new vibe drupal developer and I have created content type as an event which displays on home page upcoming event as blogs i have created a simple blog event using view home page but I don't ...
-1
votes
0answers
26 views

programmatically add vocabulary terms as new columns in views data export

I have a node type witch have a field reference to a taxonomy, I want to export those nodes using views_data_export module (the easiest way I found) in a specific format: every node field in new ...
1
vote
0answers
48 views

Display teasers in a details element

I have a view which is displaying nodes in the teaser view mode. I would like to to have all those teasers inserted into a details HTML element. This is the code I am using. function ...
2
votes
0answers
33 views

How do I get a view to list nodes that have the same detail in a particular field as the current node?

Using D8, I'm putting together a genealogy site for my family and having a hard time creating a block that lists the brothers and sisters of the Person being displayed. The basic unit of the site is ...
0
votes
0answers
33 views

View shows different data to administrator users and anonymous users

I have created a simple page that only shows JSON. The issue I have is that administrator users and anonymous users see different data. I assume this is a cache problem, but I am not sure, nor am I ...
3
votes
2answers
137 views

What do Contextual Filters filter against?

I've been banging my head against a wall trying to understand contextual filters for about 6 months now so I thought I'd give up and finally ask. Most recently I read this article on cofiguring ...
-1
votes
0answers
35 views

How to show managed_file field with Twig?

I add field with managed_file field type like this: $form['picture'] = array( '#title' => t('Upload file :'), '#type' => 'managed_file', ); I return the form in template twig ...
1
vote
1answer
41 views

How to display a custom block in a view twig file?

I added a custom block in the header of a view, and I am trying to get it to display. The block contains social media icons and links. If I want to add a custom text area, I can use this code - {{ ...
2
votes
2answers
49 views

How can I target the first item in a view?

I have a views page that shows all the latest articles that were posted. I want to show case the latest article in a different div on it's own, and then have my loop with all the other articles. This ...
0
votes
1answer
26 views

Drupal 8 Jquery/Ajax Views Arguments

Setup: I have two contextual filters, service area and ID. In my view if I send {service_area}/{id} i get back the OR query, which is what I want. My question is, when I try to use Jquery to return ...
0
votes
0answers
7 views

Transfer data from view query hook to view template

Under certain conditions I modify a view's query with a ..._views_query_alter hook. In my view template, I want to display a notice when this alteration has been made. What is the correct way to ...
1
vote
2answers
28 views

How to make exposed filters more readable in the URL?

I'm trying to make my URLs a bit more readable (and persistent) which includes query parameters of a view's page. Usually the URL would look like this when I define an exposed filter which is ...

1
2 3 4 5
296