Questions tagged [views]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
15 views

Add Relationship to Entity in a Content Datasource View?

Good afternoon, I have configured a (Search API) search index using an entity content type, but I don't need to index all the fields. Is there a way to add a relationship to the referenced entities in ...
user avatar
  • 133
0 votes
0 answers
44 views

Set a multiple twig condition in views

In a field, I wan't to display only results iltered by an if statement like this. But actually nothing is displayed. {% if ( nid == '16' ) and ( node.field_video_externe | default ) %} {{ ...
user avatar
0 votes
0 answers
33 views

Modifying the alias of a field in a drupal 9 view

I have a small problem that I can't solve from the drupal 9 configuration. When creating a view and adding a field to it, it is possible to create an alias to that field within its configuration. But ...
user avatar
  • 1
0 votes
1 answer
21 views

How do I display a view block next to the branding block in the header?

I have created a view (Slideshow) containing a Flex Slider slideshow I want to display in the free header region right of and next to the branding block. I'm using the Bartik theme; I was disappointed ...
user avatar
  • 5
1 vote
1 answer
66 views

How can I display the NID in a views table template?

I want to take the NID field and display is as the row ID in a Views table. (I can then use that ID as an anchor to jump to the correct row in the table.) However, I cannot for the life of me, find a ...
user avatar
  • 11
1 vote
0 answers
31 views

Entity Reference View as a 'Content' Field Select List only shows the last item

I have a view that gets values from a series of paragraphs in a node. The view works, and shows a list of all of the values for a field, in each of the paragraphs. I have an entity reference view, ...
user avatar
  • 59
2 votes
0 answers
27 views

Error while trying to create a local task for user order history

I am attempting to add a local task here (/admin/commerce/orders/{order#}). This local task should contain a view that takes the userid from the current order and displays that users order history. I ...
user avatar
0 votes
0 answers
12 views

How to filter out content by compare field value in user profile?

Is there any way to filter out content by compare values of the same field in nodes and user profile? I have a fivestar rating field "field_diffculty" in several content types and user ...
user avatar
  • 1
0 votes
1 answer
18 views

Does the "Search keywords" exposed filter depend on the core search index?

If I create an exposed Search keywords filter for a view, does this functionality depend on the core search engine? Do I need to index the site at admin/config/search/pages for a Search keywords ...
user avatar
0 votes
1 answer
135 views

Creating a form in a custom views field

I am working on a bit of functionality that allows a 'form' to be embedded in a custom views field on a view I am working on. The view is a table list of 'request' entities. The very last column in ...
user avatar
  • 161
0 votes
0 answers
24 views

Hide active term from the term page

I have an article content type that has a taxonomy reference field that stores the author name. It can hold multiple authors in case the article is authored by more than one author. As per the image ...
user avatar
0 votes
0 answers
16 views

How to change an exposed filter destination url?

I have a blog view that contains some exposed filters. Using the Views exposed filter blocks i added the filters into the articles that are listed in the blog. The problem is that when i use the ...
user avatar
  • 3
0 votes
0 answers
16 views

Create custom views filter to return nodes based on elapsed business days since a date field

Background: I need to produce some tables in Views that show entities that have had a certain status (based on a taxonomy field) for x number of business days. I've already set up fields and rules so ...
user avatar
0 votes
0 answers
32 views

How to output nodes tagged only one term?

I have many nodes with taxonomy term field "Tags" For example: 1 node with tid: 10, 12, 20 2 node with tid: 10 3 node with tid: 10, 16, 18 4 node with tid: 10, 20 5 node with tid: 10 I try ...
user avatar
1 vote
0 answers
24 views

Views: how show a link to the translated entity?

I'm on D9. I've a View of moderated content nodes, so of Content revisions elements. Those nodes are also translatable: the default language is it and the eventual translation is en. The views ...
user avatar
  • 500
1 vote
0 answers
14 views

Custom Flag not appearing in "Configure Relationship: Flags"

I am building a community site to link former co-workers. I have used the Flags module to allow users to tag locations/teams. I am trying to use views to now list all the users who have flagged a ...
user avatar
1 vote
1 answer
160 views

Use AJAX not working when view is rendered programmatically

I have a view that is being rendered like this $view = Views::getView('view_id'); $view->setDisplay('block_1'); $view->execute(); $render = $view->render(); $html = \Drupal::service('...
user avatar
1 vote
0 answers
12 views

Separate templates for flag links on views and node page

I have a flag called bookmark. The link to this flag is available on a View and the node page. On the view, I would like this flag link to only display as an icon as the link. On the node page, I ...
user avatar
  • 550
1 vote
1 answer
44 views

Why isn't config for Views plugin module translatable?

I am trying to write up a patch for this module: https://www.drupal.org/project/readmore. There is a patch for it: https://www.drupal.org/project/readmore/issues/3055200 which adds configurable text ...
user avatar
  • 927
0 votes
1 answer
12 views

Return two values from views exposed filter - filtered value and a default value

Is it possible to return two values when user chooses a value from a defined list? The values I wish to return are the value that a user chose AND a default value if it exists. I have a taxonomy list ...
user avatar
  • 1
0 votes
0 answers
10 views

How to create single view of webform submissions from multiple webforms

I need to merge the submission data of fields from multiple webforms into a single view. For example, 3 webforms each with fields name, date, topic. I want a single view to pull submission data from ...
user avatar
0 votes
1 answer
75 views

How can i programmatically get the value of a views exposed filter after the user submits the form?

I've searched and cant find an answer to this specific question. If I have a view and an exposed filter for that view in a block, when the user clicks submit on the exposed filter form, how can I get ...
user avatar
  • 67
0 votes
0 answers
29 views

Get count of referenced paragraph entities matching criteria

I'm trying to get a view of nodes that have an entity reference to a paragraph. The paragraph entity contains a status field. I want the view to show a count of paragraphs that have a status of "...
user avatar
  • 652
-2 votes
1 answer
26 views

How can make a string used by a view translatable?

I have a Events view that is added from the Fullcalendar View module. Is there a way to translate specific strings used from that view?
user avatar
  • 67
0 votes
0 answers
51 views

Have a view with 'sticky on top' while sorting other items by ascending publishing date

When using a view to show a list of nodes, I try to have it sorting by 'sticky on top'. As second sorting option the list should be on published date, ascending. But, doing so, the view ignores this ...
user avatar
  • 227
0 votes
0 answers
7 views

Create a line break for a link field in views

I have a table view with 5 columns and 3 of the columns is a link field. I realized some of the entries have a long title field which causes everything to be compacted and misaligned. Currently, I do ...
user avatar
0 votes
0 answers
19 views

How can I use the join handler plugin with groups and multiple conditions?

I'm trying to build a custom view filter and in the query method I need to create this join. LEFT JOIN node__field_list list ON node_field_data.nid = list.entity_id AND list.deleted = 0 AND (list....
user avatar
0 votes
1 answer
68 views

Block doesn't show up in the entity reference UI

I have an Entity Reference field, whose "type of item to reference" is block. I have a View that creates a block called staff list but when I edit content that uses that field, I can't get ...
user avatar
  • 3,939
0 votes
1 answer
23 views

Bibcite: How to sort publications by last name of first author?

Bibcite module: I have a view which shows all publications and I'm using the citation field. But every publication is shown as many time as many authors it has. When I'm using aggregation (count ...
user avatar
0 votes
0 answers
23 views

Aggregation causes problems with a computed field

I am running a Drupal 9.3.3 site and I have created a computed field in my custom module. After adding the computed field, I can no longer save a view if I also have aggregation turned on. I get this ...
user avatar
  • 175
0 votes
0 answers
10 views

how do i sum (and count ) a field across all nodes

I have a decimal field on a content type. I want to sum the values of this field across all nodes of that content type and display them with the total count on a page. I tried to do this with views ...
user avatar
0 votes
0 answers
10 views

how to implement 'most viewed/popular' content displayed in the sort filter [duplicate]

I tried with radioactivity but its not working as expected because we are using layout builder for our content types.
user avatar
0 votes
1 answer
72 views

How to do views bulk operations on all matches, not just a page

I have a lot of nodes to delete on a Drupal 9 site. I thought I could use the Content view, select the node type, click select all and Delete. However it seems that select all only selects the visible ...
user avatar
  • 3,939
0 votes
1 answer
34 views

The values returned from hook_node_access_records() aren't considered to allow access

I am implementing a solution in Drupal 9 where users are allowed to see only the nodes that belongs to their same group. If a node doesn't belong to any group, t hey should be able to see it. I've ...
user avatar
-1 votes
1 answer
255 views

Updated from Drupal 8.9.20 to 9.0.0, but can't run update.php due to errors

Here's what I get when attempted to run update.php: Requirements problem Errors found MISSING UPDATES FOR: SYSTEM The installed version of the System module is too old to update. Update to a version ...
user avatar
  • 1
0 votes
1 answer
87 views

Link to images in form view creates wrong url

I noticed this after drupal 9 update, but I've tried to find the exact moment when it was broken and I couldn't find it. I use S3 and cloudfront for images so maybe the problem is related with that ...
user avatar
  • 83
1 vote
0 answers
27 views

Programmatically load the same view multiple times with different contextual filters values

I'm trying to load a view X times but with a different contextual filter value each time. My code generates the correct amount of view blocks, but they are all the exact same. They all correspond to ...
user avatar
  • 11
2 votes
0 answers
43 views

Views performance: Teaser vs Fields

I have to create a view on a Drupal 7 site which will have 6/8 node fields. There will be some logic for which I will have to rewrite results as well as create a views-view-field-XX.tpl.php template ...
user avatar
0 votes
0 answers
28 views

Search views broken/missing after upgrading Drupal 8.9x to Drupal 9.3x

Getting error in search FILTER CRITERIA after upgrading Drupal 8.9x to Drupal 9.3x please look into the image. We are using : solr server v6.6 Modules : search_api_solr - 4.2.3x search_api - 1.22x ...
user avatar
0 votes
0 answers
36 views

Dynamically add field to Views result row

i use views_data_export to export a list of nodes to excel. These nodes of type "proposition" have many paragraphs fields, with multiple values. By default, views_data_export export all ...
user avatar
0 votes
1 answer
44 views

Display metatag description of nodes in taxonomy term views

In Taxonomy term views, where are displayed shorten nodes I want to display node's metatag description instead body summary, but it doesn't work. I'm using Metatag module with it's submodule Metatag: ...
user avatar
  • 31
0 votes
0 answers
35 views

How can I filter based on unique taxonomy term values?

I have a content type "book". One of its field "field_language" referencing to "language" taxonomy term. field_language can have only one value. Consider this is the ...
user avatar
1 vote
1 answer
115 views

How do get a value from field in if/else statement

In a custom views-view-fields.html.twig I do print a list field (field_status) without issues. The values are: new|New old|Old But if i want to do an if/else statement for printing different div ...
user avatar
0 votes
1 answer
17 views

Node reference field autocomplete and allow multiple selections in views

I recently pdated my Drupal core to 8.9 and suddenly a functionality stops working. I have a "Recipe" content type, it has a field of "Category" (field_category) which is Entity ...
user avatar
0 votes
0 answers
7 views

Using group module, get SUM from the groups content in a view

I am using the group module and each group can create "tournaments" content. Within that content is a multivalue paragraph that contains a user id and a number field. Using views, I would ...
user avatar
  • 407
0 votes
0 answers
22 views

How to make a View's exposed filter value match the Context Filter term name provided in the View path?

In Drupal 9 we have a View of Nodes with a Context Filter (Has Term Name to Term ID) and an exposed Filter for the term (called Resource Type). I can go to the Views path (/downloads) and add the term ...
user avatar
0 votes
1 answer
41 views

Disable theme debugging html comments in particular view?

we are running commerce site, still tweaking some bits, so we have still twig debug set to true, but site is already online.. we have XML feed for exporting commerce products to couple of price ...
user avatar
1 vote
1 answer
16 views

Disable certain rows of a Entity Reference Source view

I have a field that is an entity reference on a piece of content. I created a view that is an Entity Reference Source and set the reference type on the field to that view. When editing the content, I ...
user avatar
  • 407
0 votes
2 answers
291 views

Passing parameters to view blocks in Twig

Running Drupal 8.9.18 I have a string that I want to pass to a Drupal block for use in a contextual filter. In a twig template I have a view that creates a simple list of the terms to use. I extract ...
user avatar
0 votes
0 answers
23 views

How to use views query alter to show filtered content according to tags

I am new to Drupal and started learning hooks. I am trying to use hook_views_query_alter to show related content to user according to it's preferred tags. function related_content_views_query_alter(...
user avatar