Questions tagged [views]

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

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

Default contextual filter to current user but prevent altering the value in the URL

So I have the following content types: User: The default drupal user Document: Title Body ... Linked User: Entity reference (User) Please note that the Linked User does not reference the Author of ...
0
votes
0answers
27 views

When changing values in the database why does this not affect the view?

edit: How could i use Views bulk operations for the change of a field's value? Instead of directly editing mysql? I have a content type, f.e mycontentype, which has titles, like: Title - library1 ...
0
votes
0answers
14 views

Delete a content type's allowed values, and all parent nodes should not show info regarding these values

I have a content type f.e. parts, with the following values: electrical, machine, glass, liquid or NONE I also have a content type, f.e. product, where with a view one can select which part the ...
-3
votes
1answer
35 views

Based on location How to change the banner image?

I am new to drupal 8 how to change banner image based on location. i created one content type in that two fileds i am added one is banner image and another one is location. while loading the page ...
0
votes
0answers
14 views

Display many rows for one webform submission in views

I have a table view that some appointments (webform submissions) are displayed like this: Username| Visit Date | Time1 | Time2 | Time3 My question is can I "split" this row so that a new row to be ...
1
vote
2answers
100 views

How can I add a link on the “Structure” admin page?

I created a view page with the path being /abc and I want to add this link on Administrative page with a link in Drupal 8.
0
votes
0answers
20 views

How to display view table field value in add content form?

First of all, I'm new to custom modules. I have created a view with format as "Table with aggregation options". Now i have a content type, while adding data in that add content,if a form-field-ID(Ex: ...
0
votes
0answers
29 views

How to add a UNION to a query in hook_views_query_alter?

I have a custom multiple-value field (via plugin) in a bundle that needs to have an dynamic entry added prior to rendering in the view. I've tried render hooks. The problem is that if there are ...
0
votes
1answer
31 views

How can I run a Views SQL query in PhpMyAdmin?

i go to admin/structure/views/settings, check Show information and statistics about the view during live preview and then Show the SQL query checkbox that will appear below. I have a field which is ...
0
votes
1answer
46 views

Hook form alter to check date field is empty or not

First of all I'm new to custom modules, I'm using hook_form_alter to do some custom validation, in the middle I have to check if a date field is empty or not, if empty I will display an error message. ...
0
votes
0answers
16 views

Custom Search API sort logic

I have content (multiple content types) which are tagged by a taxonomy that indicates the geographical region they're relevant in. The content is indexed using Search API and Solr. Each user is also ...
0
votes
1answer
31 views

Make my view the default for content type

I am probably doing this the wrong way, so please correct me if I am wrong! I have created a new content type, called "Entities". My content type has many fields, and the default view when you visit "...
0
votes
1answer
29 views

Add content screens from the front end

I am building a web application (for trusted users), so the logged in user will have the ability to add content. However currently, when the user wants to add a record, they move from the frontend ...
0
votes
0answers
36 views

Years missing in Views' exposed field

I have media content I want to add an option for viewers can view by year from select option. I have added Published on and then checked on exposed with year checkbox as you seen in snapshot but it ...
-1
votes
1answer
40 views

How run a view in MySQL

From a view, I get the following in the Auto preview Preview with contextual filters: SELECT node.nid AS nid, node.created AS node_created, node_field_data_field_title.title AS ...
0
votes
1answer
17 views

Create a View that Displays a group of Taxonomy Terms

I have a proposed data structure like this: Asset: Title Image Description Taxonomy term: Campaign Campaign (taxonomy dictionary): term image description I am trying to make a view block that ...
0
votes
1answer
67 views

How can I have a view to load more rows on clicking a “Load more” button?

We have created a view, myview, where we want to display 3 nodes (content type = basic) and add a View All button on page load. The purpose of the 'View All' button will be to show 6 more (the view is ...
0
votes
2answers
78 views

Perform math calculation in views

On Drupal 8 site, I have a exact copy of the below excel example table made with views but without the yellow cell yet. The view is displaying one content type: Client where all the below fields are ...
0
votes
1answer
44 views

views_pre_render add class item to a row

When pre-rendering a view row is there a way to add an HTML class into a single row of the markup, allowing me to add a new background colour to the event item highlighting its importance? This is for ...
0
votes
0answers
22 views

Tabs not visible after creating view tabs

I am trying to create view tabs and follow below video https://www.youtube.com/watch?v=hpuRdzyK3jI but couldn't get any tabs displayed, only the results are displayed. I am using Bootstrap Barrio ...
0
votes
0answers
17 views

Search view with group doesn't work well

I think there is a bug with the search in a view: I created a view, which lists some used cars. I use a group filter item. Because cars are in several taxonomies. My problem is when someone uses ...
0
votes
0answers
13 views

How to know what is changing views sql query?

I would like to know what modules are altering the select sql of a view. Is there any way I could know it?. Due to this question I put some days ago, I would like to find why that sql is altered. I ...
0
votes
0answers
24 views

Expose custom db table to views to join with any entity data

We have a db table from custom module which has fields entity_id and entity_type. I need to exposed this table to views using hook_views_data() and it should be possible to join with this table within ...
0
votes
1answer
45 views

Why is my view for Solr indexing is not showing any results?

I have installed solr 8.2.0 for drupal 8.7.6. My Solr server and index are enabled and indexed. But when try to search via views, the results are not showing up. Please help me in solving this. My ...
0
votes
0answers
13 views

Creating a second page to populate posts with tag

I think the title is maybe a little bit confusing. Basically I want to create a page that will operate sort of similar to the front page but only populate with posts that contain a specific tag. I ...
0
votes
1answer
9 views

Drupal 8 Views filer results by logged in user association

Hello Drupal Views Experts First time Drupal site builder newbie to stack overflow and sounds like this is the smart place to ask a query. I have a content type "Policies". This content type has a ...
0
votes
0answers
12 views

How to sort Views on code-only field?

In a custom entity, called Foo, I have a method called getDisplayName that conditionally returns one of Foo's base fields. Foo::getDisplayName() public function getDisplayName() { return $this-...
1
vote
1answer
36 views

How can I export the raw body of a node?

I set up a CSV view with views_data_export. I'd like to export the raw body of nodes. So I want to keep both the raw markdown and the raw HTML in the CSV. Is there a way to do this that I have ...
0
votes
0answers
29 views

How to view entity when I kint or vardumper views twig?

I am using "views-views-unformatted--view-machine-name.html.twig" twig template. I want to show value of row content like folowing: {{file_url(row.content['#row']._entity.field machine name.entity....
0
votes
0answers
14 views

How do I put the bidding opportunity in Drupal Commerce Auctions so it sits next to the product information?

I am using Drupal Commerce and Commerce Auctions in Drupal 7. The default is to have the user click on a tab that links to a new node to place a bid. This is cumbersome, and all I really need (and ...
0
votes
1answer
21 views

Views date range filter adds weird condition

I have a view for a content type. This content type has a date field (only date) and I have added and exposed a filter for this field ("date is between" option). I have added and exposed a filter for ...
0
votes
1answer
14 views

Setup a view to show most recent post or a post promoted to front page

I setup a view that displays published articles from a specific content type. I want to guarantee an article always displays, so I'd like to order the results to show the most recent post. That is ...
0
votes
1answer
18 views

Display plugin entityreference is not available

I'm not sure if this is a Views issue or an Entity reference issue, so I'm cross-posting here to see if I can find an answer. I'm trying to export a view from my testing & development site, to ...
0
votes
1answer
17 views

Sub tabs similar to Media library

I am trying to replicate the user interface Media library provides in 8.8. I've created a view with 2 displays: View 1: Menu tab where Parent is "Content" /admin/content/media-image View 2: /...
1
vote
1answer
118 views

Error: Undefined index: render element

I encountered an error: Error message Notice: Undefined index: render element in Drupal\Core\Theme\ThemeManager->render() (line 200 of core/lib/Drupal/Core/Theme/ThemeManager.php). ... I found ...
0
votes
1answer
27 views

How to Determine a View Row's Content Type

I'm putting together a view with multiple content types. In my my_theme.theme file I want to set the template suggestion based on the item's content type (e.g. Content-Type-A gets Template-A.twig and ...
-2
votes
1answer
32 views

How to add custom php field views that returns my custom functions value?

I'm designing a form that creates a user on sign in. After that I'm displaying the data in a view for an admin to approve. I need to add custom PHP code that calls a function that performs approval of ...
0
votes
0answers
29 views

How can I define an offset when rendering a view with the renderRoot method?

In my app I'm calling an API to get the list of tasks as view(It has a complex html structure) and It is working correctly. But now I have to create a pagination for it. How can I pass the ...
0
votes
0answers
22 views

Add a class to a “view” depending on the value of the exposed filter

I have a view with a exposed filter, the view have the following structure. <div class="view"> <div class="view-content">...</div> </div> The exposed filter is select type, ...
0
votes
0answers
53 views

How to use Paragraph components inside of Paragraph components

I have a component-based system using Paragraphs. I create the markup in Twig (Drupal 8), then pass the values of Paragraph fields to the component's properties. So for a super basic example: {# card....
0
votes
0answers
14 views

Contextual filters on composite webform element

I need to use contextual filtering on composite elements. Webform Views Integration has previously made webform standard/contextual filtering very easy. I'm automatically able to use composite ...
0
votes
1answer
22 views

make more rare content type appear in result

I've made a view that pulls together results from two different content types - "blog posts" and "resources." This resources content type also has a field to further break down resource type (white ...
0
votes
1answer
27 views

Entity reference and associated data

Assuming I have two distinct entities A and B, with B having an Entity Reference field to A, how can I associate other data (=other fields) with the Entity Reference? For example, assume that A is "...
0
votes
1answer
28 views

Make view exposed filter shows results related to previous filter in view

About my form: In my project, i'm having a form where project name field is select(drop down) and i have to enter a field(example "sub-project"). Then i will submit the form with project name from ...
0
votes
1answer
25 views

How to get the View Header and Footer in Custom Module?

I've made a custom view and display for it like this: How do I get the Views Header (Global Summary here) ? I'm able to get the Views title like this: $views = Views::getView('items_list','page_2');...
0
votes
0answers
22 views

AJAX View not working with Webpack

I have a Drupal 8 website running in a Docker environment. I have an AJAX-enabled View that works perfectly fine when I am running my website on the URL provided by my Docker setup (http://back.d8....
0
votes
0answers
23 views

Programmatically change exposed filter's operator

I'm modifying an exposed filter using a hook_form_alter to make it a <select> of type "multiple." This works great until I select more than one <option> because the original filter in the ...
0
votes
0answers
11 views

Do not show content in view for specific field value and current site language

I have a multilingual D7 site. I have a fairly complex language hierarchy setup with 10 languages set up besides the default English. We are using the Language Hierarchy module so that we can specify ...
0
votes
0answers
33 views

How can I use <svg> tags in “Views Custom text”?

I added a custom text in views when add {{ field_svg_name }} to custom text output code field_svg_name in double quotation "<svg>...</svg>". but when add field_svg_name in fields without "...
0
votes
0answers
13 views

contextual filter result is empty then consider only FILTER CRITERIA

I have the requirement where I need to show related books. if I click on any of the books. So for that, I have used views CONTEXTUAL FILTERS with argument Content: ID and Taxonomy term: Term ID. ...