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

How to rename a view returned by REST API

Very new to Drupal (running 8.5.6) and inherited some code I need to tweak. We invoke the API request like so (which may wrap the Drupal API..I am not sure) https://api.mysite.org/backend/api/...
0
votes
1answer
35 views

Change Views BETWEEN min/max filter to a cleaner URL format?

Is there an easy way to change the default exposed BETWEEN filter to work with: price=1000-2000 Instead of: price[min]=1000&price[max]=2000? Would it be reasonable to create my own Numeric filter ...
1
vote
0answers
41 views

How can hide a row if a condition is not met by access check?

I have overrided the UserAccessControlHandler class to fit my needs: some user can not be seen by some other users. How to create a view listing only the users which can be "viewed" by the user ...
0
votes
1answer
13 views

Include referenced term's custom fields in node view with content display

I have a taxonomy term reference field in a node (D8). I have a content (node) view that needs to use a content display rather than fields. The term is selected, but not the custom fields that have ...
1
vote
0answers
39 views

How can I dynamically modify the text of the Global: result summary?

I'm using the Views module to displays search result. In the header of the views, I added the Global: Result summary to show result summary. "@total Results (@per_page per page)" //Output: 25 ...
0
votes
0answers
17 views

Creating a menu tab with wildcard, how do I make a tab only show up for certain content types? [duplicate]

I am using Drupal 8.8.6, and am about to go crazy trying to figure out something that in D7 seemed very simple. I am trying to add a view that shows up only on certain node types. Example: node/1/...
0
votes
0answers
13 views

Add a column to a view

I'd like to add a column to an existing view programmatically - but only temporarily. For instance, there is a node in the html table produced by the view. I'm gathering data from a third party api ...
0
votes
0answers
29 views

Filter content by field with multiple values and different content type

I have 3 different content types: exhibitions events programs All 3 content types have a hashtags field (a taxonomy term field). I have a view with the following filter criteria. content type = "...
1
vote
0answers
54 views

Is there any workaround for the “Global Text” area in “No results behavior” that doesn't process chained tokens?

I have a view with a contextual filter for the node ID. If the view returns no result, I would like to display a fixed picture (no problem) linking to a path containing the node ID from the filter in ...
0
votes
0answers
20 views

Limit the zoom out on a leaflet map

I'm using geolocation field. I'm trying to limit the zoom out on a leaflet map. There is the "minzoom" option with leaflet, but the option is obviously not offered by the module. Do you know what ...
0
votes
0answers
13 views

Meta-tags doesn't work in Views

I dont know why the meta-tags is not working in Views. I'm using the Meta-tag Version: 7.x-1.27 My views version: Version: 7.x-3.24 I try to change the views meta tag to any text, but it is still not ...
0
votes
0answers
27 views

Cart block doesn't show any content

After installing, the cart block view doesn't show any content, even when I had put something in the cart. I found How to hide an empty shopping cart with drupal commerce, which says the correct ...
2
votes
0answers
43 views

Why has this “details” accordion appeared in this view?

I have a view that uses the table format and the "group by" setting. I've just updated to the Drupal 8.9. Suddenly, each group has this empty Details accordion. It wasn't there before. Why did ...
0
votes
1answer
12 views

Exposed Form: Send only selected filters

I have a view with several exposed filtears. The filters are of different types: checkboxes, taxonomy autocomplete and some jquery slider (I use Better Exposed Filters module). The view shows all ...
0
votes
1answer
50 views

How do I display real names instead of usernames for referenced users?

Here are the steps which I followed: Added the user referenced field in the content type so one author can add multiple users who contributed in that content. Using views i am showing the content ...
0
votes
0answers
27 views

How do I render an image as SVG?

I want to display an SVG image as SVG code to easily change its color using CSS. I installed the following modules: SVG image, SVG Formatter, SVG image field, SVG Image Responsive, and SVG Sanitizer. ...
0
votes
0answers
23 views

How do I get the file path of a document?

I'm using views-view-fields.html.twig to display content. I can print the file name using fields.field_module_field_name.content, but the code below outputs not only the file name, but also the path ...
1
vote
1answer
20 views

Find if $view object is a block or page

I am unable to debug this because when I print the display object I get a memory error from the size. so with something like this I can get the display title. function mailnow_views_pre_render(\...
0
votes
1answer
29 views

Is filtering using images possible?

Novice here. I'm on Drupal 7. I have a content type with a title, image and body field. I've created two views to display that content. The two views are on a page and I need help connecting them so ...
1
vote
1answer
23 views

How can I hide search results until the user submits the exposed form?

I have a fairly straightforward view, which exposes a simple keyword filter to the user. Currently, when I first land on the page containing this view, all records are displayed (i.e., the search ...
0
votes
1answer
37 views

Can not override template for specific view

I'm new to Drupal so this might be a noobish question. I have a view called 'Category' where all posts are listed that belongs to the chosen category. I would like to override the views-view-...
1
vote
1answer
17 views

Sort Views table field by alphabet

Table field 'Manufacturer' is set to sort by ascending or descending and when you sort it. At first it looks like it's sorting by alphabet, it starts with A, B, C etc. but eventually ends up with A ...
0
votes
2answers
73 views

Count how many children have a reference to the parent

Explanations: 1) I have a node "parent" 2) I have 2 nodes "child" 3) Each child has a reference field (filled with a reference to the node "parent") Now, I'm trying to create a list with the ...
0
votes
0answers
11 views

Exposed form block disappear when views has no results

I created a view template for my website in which i put my exposed form block with twig tweak module. It works when there is at least 1 result. But when my view has no result, the exposed form ...
0
votes
0answers
20 views

Display taxonomy field in view on content page [duplicate]

Using Drupal 8.8.1, I am trying to display taxonomy fields in views on content pages tagged with that taxonomy. Essentially the content page would have an image header from the taxonomy image field, ...
-2
votes
1answer
19 views

What is correct way to make custom slider module? slide update problems

I have a custom slider module but the problem is if I make a new slide, it won't appear before drupal cache is cleared. So how can I renew my slides in the module so cache clear isn't needed. My Code:...
0
votes
0answers
19 views

No formatter for PHP in field selection

I am using computed field module in a Drupal 8 installation. I set up a prototype project on a Raspberry Pi, where computed field module runs like desired. Now I set up a fresh installation on a ...
0
votes
0answers
29 views

How do I apply HTML IDs to field output result?

I'm trying to build a block for tb_megamenu of a view of items of a certain content type. I want to use some JavaScript so that when the end user hovers over a title then associated content appears on ...
0
votes
0answers
44 views

PHP error in the log after PHP and Drupal upgrade

I got this error message in the log but not sure what is it about and how to fix it. Has anyone seen the same issue before and know how to fix it? Thank you so much! Drupal\Core\Entity\...
1
vote
0answers
29 views

How can I merge nodes from two sources into one render array?

So I've got a bit of a unique situation and I'm curious if anyone has any input. Summary:  I'm trying to figure out how to render 3 nodes from two different sources: 1st Source: A field of type ...
1
vote
0answers
17 views

How to display a block view if a page view has 1 single result?

The scenario is like this: I have a page on which I have the header, the block in question, a lot of other stuff, and then the page view (its a table) that actually provides the route, the footer. ...
1
vote
1answer
25 views

Views Grouping field position

I have a view and i use a date field for grouping. The position of the grouping field is at the top of the view row. Is it possible to position the grouping field at the bottom of the view row?
0
votes
3answers
22 views

Creating a view which lists all taxnomy terms and the number they appear in a content type?

So i have a taxonomy called Product Warnings, and it has around 10 terms. This taxonomy is referenced in several content types (Small products, Large products, etc), and can be selected multiple times ...
0
votes
0answers
22 views

Grouping doesn't work with content type title

I am using Drupal 8. I have a "Unit" content type and "Unit Word" paragraph. I have created the "My Vocabulary" view that shows the "Unit Word" paragraph. Now I need to group records with the "Unit" ...
0
votes
0answers
5 views

Blog articles using taxonomy lists that can also be used as menus?

Content type for blog articles that are tagged by blog name, category (blog name, category are two separate taxonomy lists). View page for blog articles with a relationship and contextual filter for ...
0
votes
1answer
11 views

Table view: “Hide Empty Column” checkbox doesn't seem to work

I've created a view, formatted as a table. I'm trying to hide empty columns – so, in the table settings, I've checked the "Hide Empty Column" checkbox for most of the table columns. However, this ...
0
votes
1answer
10 views

View only displays nodes that has comments when adding comment count field

On drupal 8 I am facing an issue with views. I created a view listing all nodes of a certain content type. I added basic fields, Title, Date content was created, and a read more link. The view works ...
0
votes
1answer
41 views

How can I show anonymous users their own content? [closed]

I've tried to reach this with views and https://www.drupal.org/project/session_node_access and https://www.drupal.org/project/views_extras with no luck. Any suggestions?
0
votes
0answers
10 views

Create view from custom SQL query

I have installed privatemsg module: https://www.drupal.org/project/privatemsg/ Now I would like to build a view with the last sent messages. But I can not build this from the views UI: I have built ...
1
vote
1answer
13 views

How to create a eCommerce site products slideshow using views

Environment: D8 with commerce module. I am working on a eCommerce website. I created a view to display the products as unformatted list. How can I change it to a slider/slideshow view? Each slide ...
0
votes
0answers
8 views

Create a new indexed field in solr search api

On my drupal site I have to fields from wich I need the minimum in my view. So I thought I could use a search api hook to create the minimum of two fields as index, but I don't know exactly which ...
0
votes
0answers
20 views

Get reference of Block entity in hook_form_views_exposed_form_alter()

How to get a reference of which block entity this current view exposed form block belongs to in hook_form_views_exposed_form_alter(). $form_state->getFormObject() returns an object of Drupal\...
0
votes
0answers
21 views

“Does not contain any word” filter

Views comes with a bunch of filters, but seems to be missing "Does not contains any word". I am looking for a way to achieve a similar function with Views but can't find anything relevant. I found ...
0
votes
0answers
8 views

Display only specific months which has data in the exposed filter, Views

I have a view where i am displaying data from one of the content type and i am filtering the data based on month and year, selected from the exposed date filter. I have added the date field in the ...
0
votes
0answers
22 views

Search api Solr add fulltext search fields programmatically

I need to change fields in fulltext search fields programmatically. I try this codes but nothing change: function MY_MODULE_search_api_solr_query_alter(SolariumQueryInterface $solarium_query, ...
0
votes
0answers
16 views

Multiple Custom Line Items with single add to cart button

I am working on a system that pulls in available dates and booking references from a third party API - we then need to add these pieces of extra information to a line_item that is added to cart. I ...
0
votes
0answers
12 views

How do I make a table sortable by a multi value text field?

I have a view with a table that contains a list (text) field that contains unlimited values. I don't find an option to make the field sortable. How do I enable a multi-value field to be sortable?
0
votes
0answers
22 views

Load only the products associated to the map sector shown

I have a Drupal site with commerce. I have a lot of products, which have their own geofield. I want to show them on a Leaflet map, but load them only at a specific zoom level (15 or 16), and only the ...
0
votes
0answers
85 views

Page title getting hide when there is no data available in view

I have created a view for content and added no result behavior. But if there is no data available in view so title showing nothing(Page title block ). But I wanted to show title in all condition. For ...
0
votes
1answer
14 views

How to add multiple conditions on a single field in views?

I have two fields in my content type. State and test . State have two values active and inactive and test is a boolean field. I want to display the content of this content type using views which will ...