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

Pass the view rows into a custom VBO action

I have a view with set of results. I want to pass the view rows into custom VBO action. I saw the below links that already implements this "pass_view" functionality in VBO. https://www....
1
vote
0answers
47 views

Create several fields from one array field

I have a Drupal View based on one entity that is pulled from another database (it is a CiviCRM entity pulled into Drupal with the help of CiviCRM Entity Drupal module). One of the fields I use is an ...
0
votes
0answers
50 views

Route name returns 404 despite working view

I'm assigning breadcrumbs based on the view route names using the following code in hook_preprocess_breadcrumb(). $route_name = \Drupal::routeMatch()->getRouteName(); if ($route_name == 'view....
0
votes
0answers
42 views

Read view row entities and create a node for each entity

I have a view that looks like in the following screenshot. I am creating a custom action to publish selected comments and create a node for each comment. The custom action code is the following. ...
1
vote
1answer
34 views

Eliminate results from a relationship (add an ON condition to JOIN)

I need to add an ON condition to a views JOIN. I cannot use a contextual filter, as it will filter out results altogether, and I need to get a result regardless (there are other joins). So I need to ...
-2
votes
1answer
44 views

How can I render a view as JSON inside a template file?

I would like to render a view as JSON, within the page template. I would hide it with CSS and use it with JavaScript. Is there a way to alter the Format field used when creating a view, which normally ...
-1
votes
1answer
30 views

Unable to pull image inside twig file [duplicate]

I am trying to show image via view twig file and below is my lin eof code: <img width="220" height="112" src="{{ file_url(content.field_thumbnail_new[key]['#item'].entity....
0
votes
0answers
24 views

Is there any possibility to capture an array with all nid of a view?

I tried using hooks but in $view->result variable I only get nodes from the actual page (10 nodes because pager size is 10). My view has multiple exposed filters so I want the resulting nodes from ...
0
votes
0answers
51 views

Send hook preprocess_views_view results to custom form or services

I am developing a feature that allows anonymous users to receive by email the result of a facets + searchAPI. Facets and Search API work perfectly. The custom module that allows to send an email too. ...
3
votes
1answer
78 views

No results behavior not showing on a view

I have a view, and the no results behavior is not showing even when there are no results. The view shows all nodes tagged with the same term as the current node. This is done with two relationships ...
1
vote
1answer
34 views

Create a view showing all nodes tagged with the same term [duplicate]

I'm trying to create a view that shows all nodes tagged with the same term as the current node. Note that the field only allows a single term. So each node (of this type) will only have a single term (...
0
votes
0answers
25 views

Plugin not found/invalid plugin error while creating VBO custom action

I am creating VBO custom action and I constantly see the below error: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "publish_TR_action" plugin does not exist. Valid plugin ...
-1
votes
1answer
20 views

How do I add link to Edit and Delete in a column in a view table item list?

I've trying to add a link to Edit and Delete column to perform desirable actions. I need help in implementing it. I've tried several suggested methods on the internet, but none did the job for me. ...
0
votes
0answers
33 views

How do I create a tab with secondary tabs?

I created a view to display all Car ad nodes. This is what I want to achieve (in terms of tabs). Administration Content Car ads (I managed to create this tab already) Published Car ads Sold Car ...
0
votes
0answers
10 views

Multiple image sets shown in a view using Colorbox

I need to have multiple image sets in a content type. I need to output them in a view that would show first image in the set (and cycle through the rest in that set) in Colorbox. I tried to set up a ...
0
votes
2answers
115 views

How to check if a path is for a view?

I have a list of paths and I would like to identify which ones are associated to view routes. Is there any Drupal 8 method I can use? Do I need to get all the view routes and then check which ones are ...
0
votes
1answer
32 views

View Bulk Operation with custom action

I have a custom action to update some table values base on node content selection. My custom actions are listed correctly on bulk update select box. But I can perform operation some random node ...
0
votes
2answers
154 views

How to programmatically load a View?

I have created a View that I want to fetch the output from within a module. On drupal.org, the latest recommendation seems to be $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->...
1
vote
1answer
13 views

Add relationships that has 3 layers, Parent -> Child1 -> Child2

Recently I asked a question that was similar (Parent node needs to display the scheduled date that is referenced in the child node), but requirements have changed and now I'm dealing with the Node A (...
0
votes
0answers
37 views

How can I programmatically check if a view's result is not empty?

Programmatically, How to check if view result is not empty with in custom function? I want to check the views result is it empty or not, and then display the result. How can i do? use Drupal\views\...
-1
votes
1answer
24 views

Change Block view using custom Views

I have one content type(Contains Image & body field). for that, I have created a custom block view using Views. currently, it's showing content like on the left side the image is placed and on the ...
0
votes
0answers
63 views

Views query plugin Undefined Index error

I have been trying to build a custom views query plugin but Im getting an undefined index error for each field that i'm mapping. The filters im using for the endpoint do work when i check them. This ...
0
votes
0answers
37 views

How can we build a view of nodes with their redirect source URLs shown in it?

I want to build a view of nodes with their redirect source URLs along with node titles. However a direct relationship cannot be established as they do not have a common reference.
1
vote
0answers
24 views

Ability to show source url in Content view for nodes who have redirects associated with them

I have a content view which displays all nodes on the site in a table with fields. Some of the nodes have redirects associated with them, which means that they have a source url associated with them. ...
0
votes
0answers
15 views

Drupal 7 taxonomy term fields not handling content filters

Image Resize Filter doesn't work with taxonomy term description. Resizing works fine in nodes and blocks, but not in views for taxonomy term. I'm loading term in my view template. And render its ...
0
votes
0answers
6 views

Grouping in Views jumbles row numbers returned by Result Counter

Grouping in a View is being used to show a list of items in a table, each row is numbered using Result Counter. However, the View uses grouping which causes the results to be jumbled. See enclosed ...
0
votes
0answers
34 views

Filter on PHP value

I created a PHP value for a view to calculate the number of days between two dates. These dates range from negative values (-303) to positive values (422). This field is referenced as $row->php. I'...
0
votes
0answers
19 views

How can I use $argument, in default value PHP, for a contextual filter?

I'm using a entity reference field on some content types. The field references taxonomy terms. Then I'm using a view to filter the available options. I'm passing the content type to that view using ...
0
votes
1answer
42 views

Display field label (not key) as views page title in contextual filter

In continuation of these questions: Override title with field label instead of key inside a views contextual filter Display title, based on exposed filter of view Page title from the exposed filter ...
0
votes
0answers
12 views

Override/remove title of view with contextual filter as a block

I have a block in a page that is a view with a contextual filter. As a block does not have a path, I have to provide a default value "raw value from URL" as per Contextual filter with a ...
0
votes
1answer
23 views

Integrating jQuery Auto Height with Views Infinite Scroll

I have a views block with an infinite scroll (using Views Bootstrap and Views Infinite Scroll modules). The block displays cards and I want them to have the same height. jQuery Auto Height does that ...
0
votes
0answers
44 views

How to replace the default page and tab of profiles in the user account?

I installed the "Profile" module on my "Drupal 9" website. When I create a profile type, the module automatically creates a tab in the user account for each profile type. For my ...
0
votes
1answer
57 views

How can I view the list of referenced nodes when viewing a node?

I have a content type with a Related pages field, which an entity reference field for nodes. How can view those nodes while still on the current node? I tried to achieve this by creating a block view, ...
0
votes
0answers
13 views

Views contextual display based on taxonomy for no value

I have a content type that has a name field and a taxonomy field that contains cities. I want the view to display by default the city as title and the message "nobody lives in city X" for ...
1
vote
1answer
21 views

Parent node needs to display the scheduled date that is referenced in the child node

I'm not sure how best to approach this problem and I'm hoping someone can point me in the right direction. Quick summary of the setup of some nodes: Node A is the parent node. Node B is a child of ...
0
votes
0answers
26 views

How can I make a widget similar to the media library, just for other entities?

I want to make widgets similar to the one that is provided by media library, but just for other entities, for instance Bibliography & Citation or even just other content. Is it possible to build ...
0
votes
0answers
33 views

How to export view's translation?

I used view translate(/admin/structure/views/view/my_view/translate) to translate a filter's label and saved. When I refreshed the view, it worked. Then I went to /admin/config/regional/translate/...
1
vote
1answer
31 views

How to display 'Welcome [first_name] [last_name]' in a custom views block? D8

I would like to create a custom block / view to display a welcome message to the currently logged in user in Drupal 8. I followed this answer but it isn't working for me. Maybe things changed in D8. ...
0
votes
1answer
36 views

Display title, based on exposed filter of view

I've read these questions: Page title from the exposed filter term https://www.drupal.org/project/drupal/issues/3087020 But it did not help. My Drupal version is 9.1.9. I have views displaying ...
0
votes
1answer
50 views

Using Filter by an entity reference view with Rewrite Results gives "there are no entities matching" error

I'm using Drupal 9.2. I have created entity reference views and use them as filter for entity reference fields (autocomplete widget). When I'm using only "Content: Title" field everything ...
0
votes
1answer
26 views

The view doesn't display products

I've edited the default product type and added a taxonomy term reference field and added some products that reference my product categories. The default taxonomy view isn't display my products, I ...
0
votes
0answers
20 views

Problem with a taxonomy view with products with multiple categories

Under Drupal, 9 I've set a Drupal Commerce site where the products can have different categories. For example, having a vocabulary like this: Category A Subcategory A1 Subcategory A2 Category B ...
0
votes
0answers
43 views

Twig sets body class even when region is not rendered in DOM

In the html.html.twig file of my theme if added the following code to body_classes to add a body class if a region is not empty: page.hero ? 'w-hero-bg', So it looks like this: {% set body_classes ...
0
votes
0answers
11 views

Get view count (ajax) on exposed filter block level

D9. I`ve created view (page) with exposed filter (BEF) in block, using ajax. Tryin to get live results count on block level. I know, there is simple way to get results in view header/footer by set in ...
0
votes
0answers
12 views

Count rows with different values for chart views

I'm using charts to display below data. FIELDS Value Type SCORE Number ENTRY DATE DATE Values in SCORE and Entry date field SCORE ENTRY DATE 7.1 2021-04-03 3.2 2021-04-03 2.2 2021-03-02 1.1 ...
2
votes
0answers
35 views

Pre-select a checkbox from an exposed filter

I have a view that lists blog articles. The blog content type has a taxonomy reference field to the 'tags' vocabulary, authors can select 1 or multiple tags. The view exposes the 'Has taxonomy terms (...
0
votes
0answers
36 views

Why doesn't breadcrumb work for taxonomy terms?

I have created url patterns for the taxonomy terms in the "Article category" vacabulary. I want the breadcrumb trail to look like this: "Accueil"> "Blog"> "...
1
vote
0answers
14 views

addField() does not properly ensure table?

When I create a view with a table display, I configure the table columns to be sortable and set Dinstinct to avoid duplicates. I get the following SQL error. General error: 3065 Expression #1 of ...
0
votes
0answers
9 views

Views table display with sort and DISTINCT error: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list

I have a node view, page display with format "table" where the changed date is set as the default sorting order by the table settings. When I set "Distinct" for the view I get the ...
-1
votes
1answer
22 views

How to add anchor to a single block displayed on specific pages within the same page?

I have a basic layout for a Drupal 8 site, created two blocks with block 1 containing menu with static content and links to pages, and block 2 for subscription form, The block 1 and block 2 are called ...