Questions tagged [views]

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

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

Drupal Views filter on a Date field does not work as expected

I have a Drupal7 view which includes a field of Date type (let's say "activity date") via a relationship. I want to filter this field by "today" (show only activities with activity ...
user avatar
  • 121
0 votes
0 answers
45 views

Counting node type in View throws SQL error

I have field Content:Type that I aggregate with COUNT to show the number of nodes of that specific content type. But I get this SQL error: SQLSTATE[42000]: Syntax error or access violation: 1140 In ...
user avatar
0 votes
1 answer
30 views

Add formating to custom views's field (to remove sourounding quotes for the JSON values)

My custom views field returns JSON as a string: "order_line_items": "[{"sku":"GC2","quantity":"5.00","price":"50.00"},{"...
user avatar
0 votes
0 answers
21 views

Contextual Quick Edit icon is missing for some of the blocks in Drupal site

Am using Layout builder for the website. On some of the pages am not able to see the Contextual Quick Edit icon. This will not allow us to do any configuration for the particular block/Page. Please ...
user avatar
  • 11
0 votes
0 answers
25 views

How do I convert custom entity's created timestamp to date format on save to database for filtering by date in a View [duplicate]

I am using Drupal 9 I have a custom entity which I am using to log some events. In my view, I wish to add a filter to retrieve entities created between two dates. My view displays the date as dd-mm-...
user avatar
  • 1
0 votes
1 answer
60 views

How to get exposed filters for entity reference to render?

I am using a entity reference view and I am able to filter via taxonomy terms directly, but when I set it to exposed and let the user decide, it does not display on the form. How can I get the expose ...
user avatar
  • 367
0 votes
0 answers
20 views

How to sort addresses by Street name in Table View?

I have an address directory set up as a view on my D9 website. One of the columns has full addresses like this: 1 Main Street Columbus, OH 00000 I'd like to be able to allow sorting the column by the ...
user avatar
  • 1
0 votes
0 answers
34 views

Use contextual filter and path arguments

I have a view, displayed on /user/%user/library, which shows a list of nodes. I want to add a contextual filter, for example field_premium_id. I tried to add the two arguments there, but %user is not ...
user avatar
0 votes
0 answers
51 views

How can I get an image URL in a view field?

I followed what suggested in How can I get the image URL in a field? It worked well until I migrate to Drupal 9. It now displays /system/files/provider/products-variations/1/collier-saskia-bleu-nuit....
user avatar
0 votes
0 answers
40 views

Clear specific view's cache programmatically, specific to contextual filter

I am using the following to clear view specific cache on node_presave which is working fine. cache_clear_all($view_name.':'.$display_name, 'cache_views_data', TRUE); Currently, it is deleting all ...
user avatar
0 votes
0 answers
28 views

How do I get JS event attached to multiple views rows

I am creating a custom views field and need it to have JS attached to it's on click functionality. When I get one views result, it works perfectly, but when I have multiple results, it only attaches ...
user avatar
0 votes
1 answer
20 views

If content not published, hide also for admin

I have a entity browser which list my produts. The products are shown only if they are published. But for some reason, if the product was added before the filtered "publish" was set, the ...
user avatar
  • 57
0 votes
0 answers
16 views

How to add multiple html tables in one view or page

I created, 4 tables with the datatables module, but I need to leave the 4 in a single page or view, I tried with dashboards and with draggable dashboards, but they only work on the administrator side ...
user avatar
  • 101
0 votes
1 answer
43 views

Not all tokens are replaced

I like to work with tokens a lot. In the node view it works well with the tokens. All tokens are displayed correctly Now I have built a view and in the header of this view I would like to work with ...
user avatar
0 votes
1 answer
65 views

How can I display user information along with its choices?

Usually, polls are anonymized. We need to process total votes, percentages... Now, in the context of Ukraine invasion, an institutional client wants to enhance an Advanced poll existing implementation,...
user avatar
  • 3,472
1 vote
0 answers
134 views

Reload commerce_cart_form view

I'm coupling Drupal commerce, DC add to cart ajax and commerce flyout modules. This is my view configuration : On my /cart page, I have the initial form (the view) to change the quantities, delete ...
user avatar
  • 57
-1 votes
1 answer
83 views

View plain text field causing rendering issues for translations

Our news section has a plain text field for article header. At the time of development this seemed like a good idea, however, having gone live, some languages like French has special characters which ...
user avatar
  • 173
0 votes
0 answers
43 views

How can I customize an administrative view template from a custom module? [duplicate]

I created a view with a page display whose path is /admin/content/noun, and whose format is table. I'd like to override the table template with views-view-table--the-view-name--the-display-id.html....
user avatar
  • 275
-5 votes
1 answer
249 views

how to get url of link to content in twig? [closed]

I just created one view block to show all my blogs in it. I am getting all fields in twig but unable to call "link to content" to current node of every blog from view block. Any solution ...
user avatar
0 votes
0 answers
29 views

How can I standardize the query from exposed form input?

I apologize in advance if the title for this post is misleading, my intention is to use exposed form input from a form in a block display (not on the view page) to build a query on a page display for ...
user avatar
  • 349
0 votes
1 answer
42 views

Table view combined fields, separate sort

I'm looking for some assistance in setting up a table view to be able to sort merged columns separately. At a high level I have the following view table: First Name Last Name Age/Weight^ Ken ...
user avatar
0 votes
2 answers
110 views

How do I add HTML markup to the title?

I am trying to alter my title to include html. I have tried the following function MODULENAME_views_pre_render(\Drupal\views\ViewExecutable $view) { if ($view->id() == 'products_test') { ...
user avatar
  • 133
-3 votes
1 answer
41 views

How do I add an exposed form to search products?

I installed the Search API module and followed the documentation to set up an index and a search box using views and facets. It doesn't show an exposed form to search, even though there is a view and ...
user avatar
0 votes
0 answers
26 views

How to get a link to an attachment field in a form

I have Webform filled by employees. Each user fills the form and submits it. Then a supervisor comes and uploads an attachment to each user's submitted form. How do you create a link that the ...
user avatar
  • 214
0 votes
0 answers
42 views

Tokens are no longer replaced after upgrading

I have a CKEditor field in my nodes. The content of the CKEditor field consists of text and some tokens. The replace tokens thing works quite well within the node. However, after updating from Drupal ...
user avatar
1 vote
1 answer
111 views

View won't update unless caches are cleared

In a Drupal 9 site I've built a view that displays specific content for each day of the month (filtering by a date field). The view shows the correct content for the admin user but not for anyone else ...
user avatar
  • 43
0 votes
1 answer
39 views

Using Views to list nodes that have the same field value as current node

I have a content type with has one particular field (among many other fields). I need to create a block that will list all other items of that content type with the same field. Doing this for related ...
user avatar
0 votes
0 answers
40 views

Preprocessing view if grouping is enabled

Views has base template views-view-unformatted.html.tpl with contents: {% if title %} <h3>{{ title }}</h3> {% endif %} {% for row in rows %} {% set row_classes = [ ...
user avatar
0 votes
0 answers
73 views

Customize RSS feed

I'm trying to create a RSS feed with 3 news items and one custom item. This custom item needs to be build manually. I want something like this. <?xml version="1.0" encoding="UTF-8&...
user avatar
  • 924
1 vote
0 answers
24 views

Why do relationships return only one result?

I am using Drupal 7. I created a view that uses 8 different (chained) relationships to access a specific entity type. Then, the view displays some fields of this entity type. The view has some filter ...
user avatar
  • 121
0 votes
1 answer
54 views

How do I make links from views to be opened in modal popups without adding custom rewrite?

I was trying to find if there is a way to avoid writing custom rewrite for links to open in modal popups from a view. Here is what I am rewriting a custom field for doing this now. <a href="...
user avatar
  • 880
0 votes
0 answers
29 views

How to recover 1 missing view and webform out of many after moving to another server?

After moving my Drupal 9 site to a different server I see all views in the Views UI, but one. Same with one webform. All are there, but one. I looked in the config database table and the view and ...
user avatar
1 vote
1 answer
81 views

Is there a way to default sort by date when no search keywords have been used, but default sort by relevance for all searches?

At present, my project has default search pages for sections of the site. They are per-content type. When the user goes the "search page" for the content type, they see a views-generated ...
user avatar
  • 117
0 votes
0 answers
18 views

View to return multi-nested criteria

My website has articles. Each article has a field 'region restricted' (default is OFF). I want to on my view display all articles which is not restricted but also show articles that are restricted and ...
user avatar
  • 173
0 votes
0 answers
17 views

Exposed filter on a number field also shows results when filtering with less digits

I have a number field that contains mostly 4/5-digit numbers. This field is exposed in a view. I want to also show results when putting only the first, second, and third digits of the number into the ...
user avatar
2 votes
0 answers
161 views

"A non-existent config entity name returned by FieldStorageConfigInterface::getBundles()" errors in watchdog

After migrating from 7 to 9, I'm getting a lot of these errors in watchdog, from views. A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: paragraph,...
user avatar
  • 3,939
0 votes
1 answer
19 views

Default product URL for a pager

Does anyone know how to get around the view error about the default product that doesn't have a URL? The Commerce module has a default product and the view pager works without a More link, but it ...
user avatar
2 votes
0 answers
39 views

How to show content that is not yet translated (Untranslated Content)

I am fairly new to Drupal – spent the last 3 months getting to know my way around. I have one question. I have to create a multi-language site for English and German users. I'm the site administrator ...
user avatar
  • 21
0 votes
0 answers
22 views

views-form twig template

Is there a way to override a views-form template? I am using views bulk operations and attempting to add in some custom functionality into it via hook_form_alter, but part of the functionality ...
user avatar
  • 161
0 votes
1 answer
11 views

Disabling Flag link access on view

I have a custom entity displayed in a view. If some field is of a certain value, the Flag link should not be available and replaced by some text. function my_module_preprocess_flag(&$vars){ $f = ...
user avatar
0 votes
1 answer
39 views

Views Block Language Detection

I have a site with two languages (EN/FR). I have a Content Type (Article). I have a Block built with Views that is displayed on the Article Node page. This Views Block has a translation. When the user ...
user avatar
  • 550
0 votes
0 answers
12 views

how to customise view template for template provided by views addon module

With core views, I just copy paste the views template to my theme, and am able to override. for example by calling views-view--my-view.html.twig. If I am using an add on module for example, views show ...
user avatar
  • 133
0 votes
0 answers
18 views

Views : blank pages when too much results

I'm using the Geolocation module to display a map of locations. I have about 550 locations to display currently and I need them all on my map. But whenever I try to show more than 300 results the page ...
user avatar
  • 11
0 votes
2 answers
59 views

Pass one exposed filter onto another?

I have about a dozen string fields that contain objects and their states (for example, let's take 'AC_on' and 'heater_off'). And I have a view that shows nodes containing those fields. The task I'm ...
user avatar
0 votes
1 answer
43 views

How to list content that references another content type through paragraphs

I have two content types: "Author" and "Document." The Document content type uses a Paragraph "Author_citation" to connect the two and display all the authors (plus other ...
user avatar
0 votes
0 answers
31 views

Add prefix on tables break my site

I have an old site on an old shared server which used an old shared PHP 5 we can not update. I create a copy of this website which will run on a different (and dedicated) server with PHP 5.6 and ...
user avatar
  • 611
0 votes
0 answers
42 views

Getting error while adding/rearranging sort in Views. Drupal\Core\TempStore\TempStoreException: Couldn't acquire lock to update

I am trying to add/rearrange a sort criterion in view in drupal 8.x, but getting error - Drupal\Core\TempStore\TempStoreException: Couldn't acquire lock to update item 'search' in 'tempstore.shared....
user avatar
0 votes
0 answers
26 views

Contextual filters don't work with url aliases

I use contextual filters in a view to get the node ID from the URL (for example, node/6716/v1-vv-autor). These are contextual filters settings. I would like to set a URL alias for the node, set using ...
user avatar
0 votes
0 answers
34 views

How to create a custom Views filter to filter nodes on a field value (string) if it's in multi-value field on the user's profile?

We have a Drupal 9 site where we need to filter a view showing nodes where their "US State" field value is contained in the user's "Assigned States" multi-value field. Node: "...
user avatar
0 votes
0 answers
23 views

How do I filter the release based on the selected product in an exposed filter?

I have a content type (Book page) with reference fields to two taxonomy vocabularies (Product and Release). The fields of that content type are the following. The terms of the Product vocabulary are ...
user avatar