Questions tagged [views]

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

Filter by
Sorted by
Tagged with
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
28 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
28 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 ...
1
vote
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
12 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 ...
1
vote
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
31 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
16 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 ...
1
vote
1answer
19 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
8 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
21 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
12 views

Custom User Field Hook_query_view_alter()

I want to dynamically filter a view using the hook_view_query_alter. My goal is to be able to display all the users for the sub-admin in a view that has the same custom field as it. But I don't ...
0
votes
0answers
40 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
34 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, ...
1
vote
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
25 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
20 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
17 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
26 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 ...
1
vote
1answer
35 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
20 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
14 views

Problem with a taxonomy view with Drupal Commerce 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
33 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
6 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
9 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 ...
3
votes
0answers
27 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 (...
1
vote
0answers
35 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
13 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 ...
1
vote
0answers
7 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
18 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 ...
0
votes
0answers
22 views

How can I get the ID of a group of fields?

I have an unformatted list view with two fields, the node title and a taxonomy term. I am grouping on the taxonomy term. What I'd like to do is add a class to the <h3> tag for the group title, ...
0
votes
1answer
18 views

Can I use a contextual filter to remove content?

So I have this view that searches for content (articles, blogs, etc.) associated with a particular author name. Is there a way with this that I can pass a contextual filter of taxonomy terms that ...
0
votes
0answers
26 views

Display products related to a content type through a vocabulary

I have different product variations with a vocabulary (Artist) which is also used for the Artist content type. How can I use a view to show the related products which use a specific value from that ...
0
votes
1answer
17 views

How can I add classes to rows depending on the loop index?

I have received a design where they want to have the latest three articles links put on the top of the front page (over their respective images) so that the first is taking left half of the page and ...
2
votes
1answer
49 views

Behavior to use .insertAfter() on load + after each ajax call?

So I have a views page that outputs some elements in the grid. And I have a custom block on the page that needs to be inserted between those elements. On load it using .insertAfter() to randomly ...
1
vote
1answer
27 views

How do I create a block that shows content related through a second level relationship?

I have three node content types, called 'pathway', 'page' and 'relation'. The relation nodes I use to connect pages to the pathways. The relation nodes have entity reference fields: endpoint A and ...
-1
votes
1answer
34 views

Display a picture from an article related to a product

This is the scenario: There are multiple products (paintings). Each one of these paintings has one author, which is defined with a content type. There is a reference field form the product to its ...
1
vote
1answer
16 views

How do I change pager (# of items) for one page display in a view?

I have a view that will have about 7 different display pages. Some of the pages will have a different amount of items displayed on that page. When I'm on my Publication Page (display name) and change ...
0
votes
0answers
19 views

How to rewrite a Views RSS?

The RSS Views Feeds are very restricted. I created an RSS Views Feed to display the Message (https://www.drupal.org/project/message). I want to rewrite the RSS Views Feed and I want to display the RSS ...
0
votes
0answers
46 views

How can I invoke a custom submission handler for a view field?

I would like to display a button for each content displayed in a view. In a custom module, I have added a custom submission handler to the edit form (hook_form_FORM_ID_alter()) and defined the action ...
0
votes
1answer
17 views

Link to a referenced entity

I have a entity A with an entity reference to entity B, and an image field. I created a view to display an entity A. I want to link the image field to the page displaying the referenced entities B. ...
1
vote
0answers
14 views

Excluding other parent taxonomy terms when one is selected in “Filter criteria”

I have a table in a content views with a list of four content fields: City 1, City 2, City 3, and Tourist. Because the cities were all taxonomy references in this particular content type, I created a ...
1
vote
1answer
60 views

Redirect Search API view result (Leaflet map) to display in a pane

The particular Search function starts as Full Panel Page in a style to a Google Maps Location Search page; Search Input (Block) to the top left overlaid on a current Leaflet map based on the logged-in ...
0
votes
1answer
37 views

How do I use a term as contextual filter correctly?

I'm using Drupal 8. I have a book content type that uses a vocabulary called "book type" as an entity reference field. I have basic page content type which also uses the the vocabulary "...
1
vote
1answer
75 views

Setting custom key names for exported JSON view fields

I have a result set similar to this (using Views RESTful Export): My question, how to change created_1 key and name it something else?
0
votes
1answer
26 views

How to display the first child of a book with the title of the book and keep the url by using a view

Is it possible to display the list of the first child of every book with a view? I couldn't figure that out so I added boolean to the book content type to check which child is the first child. If that'...
-3
votes
1answer
16 views

Attached all images from taxonomy in view

I am creating a view of a content type and content type is linked with you to taxonomy with has images. Now, i have added Relaionship as well. But now if my node is attached to muliple taxmony term it ...