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
24 views

Ajax doesn't reload exposed filter correctly in block when using hook_form_views_exposed_form_alter

Using hook_form_views_exposed_form_alter to change the exposed filter from text field to select list (for node reference) // Start building out the options for our select list $options = [];...
1
vote
1answer
25 views

How do I add the “- Any -” option for the published status on exposed filters?

I need to add the - Any - option for the published status, on exposed filters. I can't use it, as when I try to add it, I get the following error. You must select a value unless this is an non-...
0
votes
1answer
5 views

One contextual filter based on two entity reference fields

I have two content types. Doctor Location Doctor has two entity reference fields. Both reference Location nodes. Primary Location Secondary Location I need to create a view that appears on a ...
1
vote
0answers
26 views

How can I tablesort by term weight instead of term name?

I've got a View for Nodes and display some fields as column. All columns should be sortable. One field is a term reference. In order to sort the terms by names I create a relationship on the ...
0
votes
0answers
19 views

Retrieve shipping address fields

I am trying to retrieve the shipping address from the Shipping module in a view, and I could get it, but I want to export the address to a CSV file and I need the address as name, address line 1, ...
0
votes
1answer
26 views

Check for last row

Is there any way to find the last row from view itself.I have to add some extra html for the last item. I know we can do this using view's twig template, but I want to know is there any option in the ...
1
vote
1answer
44 views

How to find the viewid and view-display-id?

I'm trying to customize a view displayed in the homepage. Specifically, I'm trying to build slideshow with Bootstrap Carousel. I've checked this page, but I don't understand how to find viewid or ...
0
votes
1answer
51 views

How do I set the default value of an exposed filter to a value that is not “-Any-”?

I have a view with exposed filters, in Drupal 8. I need to set the default value of a filter to its title or custom text. I also need to unset/remove the - Any - option from the select list. How can ...
0
votes
1answer
33 views

How do I sort by day?

Hi I have a bunch of items which occur on a given day of the week. So i have a text field called Day, and it's populated by the words 'Monday', 'Tuesday', 'Wednesday' etc. Is there a way to sort this ...
1
vote
2answers
113 views

Show all user profiles and geolocated content on a map

I'm trying to create a map that shows user profiles and other geolocated content (for example, news and events). A view doesn't allow to mix users and other content. I know I can show content that is ...
0
votes
1answer
24 views

How to insert table view inside another view?

I have created a View and two display blocks inside the View and set the format to table on each. like this: I will display these two tables at the front page. Now I need to write a common for both ...
0
votes
1answer
18 views

How to style nested paragraph fields without duplication, in Views (and nested fields appear)

Drupal 8.. This may be a two-part problem. I want to avoid repeated content due to multiple values in a nested paragraph reference, but ALSO put the nested paragraph fields into a custom text field, ...
2
votes
0answers
26 views

Can entity IDs (node, taxonomy, etc.) be synchronized across environments?

It seems the content synchronization module syncs entities UUIDs, but not their entity IDs (like TID, NID, etc). Since it only does UUID, this can result in environments with mismatched IDs for the ...
2
votes
1answer
39 views

“Content: ID” versus “Content: Nid”

I'm just getting to know Drupal. I've been manually recreating current Drupal 7 Views from a production installation into a new development install of Drupal 8.85. I've run into some differences ...
0
votes
0answers
9 views

Removing comment from front page view

I recently added the Disqus module to my website. I have it up and running however I've noticed that when I go to my front page the most recent post always has a comment section at the bottom of it. ...
0
votes
0answers
33 views

Return 0 as a number and not a string

I'm trying to return the count of ER of a node in a view in rest export. I need to return 0 if actually there are none. The problem is that everytime there are no result "0" is returned as a string. ...
0
votes
0answers
32 views

How to get a content type name out of view programmatically

How to get a content type name out of view/views programmatically? I have a view views_of_articles of (content type article), what I need is which hook I should to use to return the content type for ...
0
votes
0answers
18 views

Better exposed filters, hook form alter to specific template

On a view there are two exposed filters in one page. Rendered by BEF. For the template with BEF, I have a custom template. I need to alter this template. The #form_id and #id are exactly the same in ...
0
votes
0answers
6 views

Calendar module initialise with latest event date month

I have event content type and I have created a calendar view using calendar module. I want to initialise that calendar with the month which has the event included. For example , the first event ...
1
vote
1answer
56 views

How can I embed a view in a template when passing view name and parameters are passed as variables?

Inside my paragraph template I have variables which contain category id and view machine name. So when I print them like this: {{ content.field_category }} {{ content.field_view }} I get correct ...
0
votes
0answers
9 views

Refactoring custom module to handle views after migrating off of drupal/media_entity

I administer a drupal 8 (8.6.4) site and am trying to migrate us away from the drupal/media_entity contrib module and into the media support in drupal/core. I have successfully completed the ...
0
votes
0answers
7 views

Combine fields filter doesn't work with Taxonomy name

Using: Drupal 7 Content type has title, body and category(taxonomy field). Adding a combine fields filter to search these three fields, the search works with title and body fields. But doesn't work ...
0
votes
0answers
42 views

Entity reference view that return set of views?

I have a field in Entity reference type for selecting a view. It works well (allowing the user to select the view) but I want to narrow down offered values, to sub set of some specific views. When ...
0
votes
0answers
18 views

Views hook_views_query_alter custom condition

I have a views map content with countries and regions fields. Both fields accept multiple values. Then, I added countries and regions filter. The results are confusing due to the multiple countries ...
0
votes
1answer
31 views

Need help with taxonomy term creating a users view

I have a taxonomy field in the user registration form called location, I have a view listing all location terms (taxonomy terms). I'm having trouble linking the terms to a view (containing the users ...
0
votes
0answers
6 views

Find multi-value field that has X or more values

I have a multi-value field that needs to change to a single value field. Changing the cardinality doesn't work because there are some instances that have more than one value. How do I find those ...
0
votes
1answer
14 views

How to display parent term name of a term located in a paragraph?

I have a vocabulary for employees, which has a paragraph field. In this paragraph entity, I have two fields. One for date and one for the job title. The hierarchy goes like: company > department > job ...
0
votes
1answer
23 views

Entity reference field search by custom field

In my setup, a user can own more entities of a specific content type but the ownership is stored in the entity. The user entity does not 'know' anything about this. I know without context it seems ...
0
votes
0answers
24 views

Upcoming birthday list in views, based on birth date

In Drupal 8 I created some extra fields at "user", such as date of birth" (dd-mm-yyyy) I want to show in a block in views the upcoming birthdays. BUT...I can't sort them on date, because the order ...
0
votes
0answers
73 views

AJAX loaded block with form not saving values

I have a page with multiple rows. I used a global view field to embed a view as a field. This embedded view has multiple editable fields (exposed forms). When I display more than 30 rows the global ...
0
votes
0answers
21 views

Count how many nodes have been updated per user

I am using Drupal 8. I have been trying to find how many nodes (count) have been created by each user of my drupal site. Following some excellent (although quite old) threads here and here among ...
0
votes
0answers
6 views

Display related content by taxonomy and children and also hide specific child taxonomy

I want to be able to display related tagged content by taxonomy and Children. I have this working with has taxonomy id with depth. Now I want ability to also hide specific children tags. On a node ...
0
votes
0answers
7 views

View to display Contents types of groups only if user is member or owner of that group

I am trying to create a view where I can show contents of groups only if user is a member but what I can do is either show all groups where the user is member or show all content of a group. I want to ...
0
votes
0answers
15 views

View with ajax enabled and webform as entity when there are no results is not sending webform

I have view with: Block: Map (Google Maps with dealers) Attachment (list of dealers below map) (inherit contextual filters: yes, inherit exposed filters: yes) Exposed filter visible for visitors (...
1
vote
1answer
34 views

How can I pass multiple values to drupal_view()?

I'm on Drupal 8 and I have a view with multiple argument (list of node ID) but I can't embed this on my node.twig.html. That's my code: {% set myArray = [] %} {% for item in content....
0
votes
0answers
15 views

How do I give access permissions to custom text field plugin?

I want to give access permissions to custom text field handler in views to display the field based on the user permissions. This is my custom view field handler referred to: https://www.webomelette....
0
votes
0answers
12 views

How can we show up active filter values in exposed filters?

I have a requirement to show up selected filter values from views exposed filter. For ex: When I select OptionA from filter-1(select list) and OptionB from filter-2(select list), Results will get ...
-1
votes
1answer
17 views

How to make a listing page of contents without using UI

I'm currently trying to make a Drupal 8 site that will show a list of actors with their image, description, and rating. I have already done so using the drupal UI itself but I want to achieve the same ...
0
votes
1answer
29 views

How to hide body field in a view only on certain content types

I have a search result view of different content types, and i want to show the body field (trimmed) on some content types, but show no body on other content types. Since they all share the same body ...
0
votes
0answers
36 views

Twig alter replacement patterns / rewrite results views field

I have some text I'd like to alter in the custom output of a views field. For example, if the output contains the word "pancakes" I'd like to replace it with "waffles". {{ field_recipe_prep__value ...
0
votes
1answer
26 views

How do I get block relationships for a content type?

As part of a migration from drupal 7 to drupal 8, I currently have a rather original node display method that I'm trying to reproduce to Drupal 8, but without success. Currently on Drupal 7, this ...
0
votes
0answers
19 views

Group paragraph fields in Views

I've added the paragraphs field as a relationship and managed to add my fields to the view but I can't seem to group them together. As a result the node entity is being spit out twice. Is it possible ...
0
votes
0answers
22 views

When the view has no result, there is an error

I created a view to display a block on my store page, but the page displays an error when the view has no result. If the view has a result, it works. What's the problem? When I go to my store ...
0
votes
0answers
18 views

How do I set granularity to an END date value used as sort criteria?

I have a Date field with start and end dates (mm-dd-yy). I need to build a View listing nodes grouped by end date year and sorted first by descending end date year and second by ascending title. ...
1
vote
1answer
43 views

Custom node access control not working with access filter?

In some of mine content types I have checkbox field "Content protect". If checked that node should be visible only to registered user. If not checked - visible to everyone: function hook_node_access($...
0
votes
1answer
35 views

Programatically change exposed filter value based on another exposed filter

I have 2 exposed filters in my Drupal 8 view - both are select dropdowns. I want the value of the 2nd filter to change based on selection of first filter Here are the filters $filters = $view->...
0
votes
1answer
34 views

Programmatically creating a custom block

I followed the steps from https://www.webwash.net/programmatically-create-block-drupal-8/. I have a view already created and I want to render this view in this block. I can't find a good ...
0
votes
1answer
11 views

Hiding view filter option based on another filter selection

I have a view with search criteria and the search criteria looks like below: Age group(options: new born, toddler, pre-school) Classroom (options: NA, potty-trained, transition, not-trained) All ...
0
votes
1answer
20 views

How to get replacement pattern for Search API's fulltext search in global text area header

In Drupal 7, I'm currently using the default core search, and a view for node search results. I have a global text to pull in the replacement pattern for the term that were searched for. I get the ...
1
vote
1answer
24 views

Views alter changes next row instead of current one

I have a view that is showing event content types. Users can apply for these events. I am using a hook to alter the 'view applicants' so I can show how many applications already excist. The ...