Questions tagged [views]

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

Filter by
Sorted by
Tagged with
-1 votes
0 answers
16 views

Views - row to column transform(D9)

Is there any module in D9 can provided matrix style? Or can serves in transforming rows into columns? Module "Views Matrix" is very close to what I want to do but it is for D7 only. I have ...
user avatar
  • 1
0 votes
0 answers
6 views

Define a custom taxonomy view for only a specific view bundle

I would like to define a unique view for a specific taxonomy type that will show anytime a user visits the cannocial URL of a specific term. The default URL for this is taxonomy/term/[term-id] as ...
user avatar
  • 323
0 votes
0 answers
32 views

Help to avoid using PHP filter in an entity reference view

My site is about chemistry labs which uses many studios like a blood test. Some studio fields are Gender (male, female, both) and Age (2 fields, min and max values, could be days, months, years). ...
user avatar
  • 1,588
0 votes
0 answers
8 views

View children items of parent and sub taxonomy terms on the same page

I am working on a view with taxonomy terms. The taxonomy list has multiple levels of taxonomy terms, so for example: Level 1 (parent) Level 2 Level 3 Level 4 I am using views_tree to create this. ...
user avatar
  • 25
-1 votes
0 answers
37 views

How to solve serializer issue while sending an api get request?

I have a drupal 9 site with PHP 8. I have one GET API. While i send the request i am getting an error like The website encountered an unexpected error. Please try again later.Symfony\Component\...
user avatar
0 votes
0 answers
15 views

Trying to customize template of a form rendered by a view

I'm using Drupal commerce and it's cart form for a client's site and I cannot manage to find an accurate template to customize it. The cart's form is rendered from a view. I'm trying to suggest a ...
user avatar
-1 votes
1 answer
18 views

save draggableview weight

I have a question related to draggableview (DV) integrated in Drupal 9. How can I save DV weight field value in other content type field called "field_priority" ? I found this info but it's ...
user avatar
0 votes
1 answer
36 views

Why does my custom views filter error with 'InvalidArgumentException: The configuration property...'

When I configure the view, it looks proper and works fine until I try to save it, at which point I get this error: The website encountered an unexpected error. Please try again later. Checking the ...
user avatar
0 votes
0 answers
15 views

How do I filter based on the order type?

I have two order types, Default and Standalone, and the goal is to filter based on these two values. Adding the field in the table format of the view was easy, but trying to add the filter seems that ...
user avatar
0 votes
0 answers
41 views

TypeError: Argument 1 passed to Drupal\views\ViewExecutable::setRequest() must be an instance of Symfony\Component\HttpFoundation\Request, null given

I am trying to get number of rows in a view by executing this function in my custom module in Drupal 9.3.x: function module_custom_view_count () { $view = Views::getView('site_images_page_1'); ...
user avatar
  • 11
0 votes
0 answers
12 views

Error when adding a custom global field in views

In my drupal commerce, I'd like to add a textarea where the user can make some comment on his order (which will be added to the commerce order comment workflow) So I've generate with drush my field &...
user avatar
  • 57
0 votes
0 answers
9 views

Better Exposed Fiters: Render jQuery UI-Slider in Twig

I set up a template for a views exposed filters like: views-exposed-form--machine_name.html.twig I can render the whole form with {{ form }} Also, I can render every form element like {{ form....
user avatar
0 votes
0 answers
19 views

How to have schema image on views page

I am struggling to find a way to have an image object appear in the schema markup for a views page. Ideally I would set this through the MetaTag module but am open to doing it programatically. The ...
user avatar
0 votes
0 answers
23 views

Template output singe fields from entity reference fields from other content type

I have "Carousel" content that calls another "news" content type. I created the view that shows the teaser of the single news. I would like to create an html inside the .tpl "...
user avatar
1 vote
1 answer
23 views

Accessing /admin/content returns "Page not found"

The stock Content view in a Drupal 9 install is returning a 404 when accessing /admin/content. We added two contextual filters to this View that are ignored if you are an Admin (passes "all" ...
user avatar
  • 26.8k
-1 votes
0 answers
30 views

How to add text that there are no search results for such entered word to a custom block?

I have a view that searches for indexed entity fields using context filters. I added a custom block to the view like this: {{ drupal_block('result_entity_product_categories', {arguments}) }} This ...
user avatar
  • 11
1 vote
0 answers
19 views

User error: "attributes" is an invalid render array key Error for Custom theme Views Preprocess Function

Okay I have added the following custom views Preprocess function in my custom theme: function mytheme_preprocess_views_view_unformatted(&$variables) { $view = $variables['view']; $rows = $...
user avatar
  • 11
0 votes
0 answers
17 views

The image field disappears and the view is set to disabled

We've had this happen several times now and can't figure out what is happening. We only realize it has happened when we try to go to a view that is affected. All views with an image field in them are ...
user avatar
0 votes
0 answers
16 views

How to select nth-child in views rewrite

I have a content typewith an imagine field that allows multiple images... but i wasnt to write the images so that th first images has its own style. See code: <div class="image-grid"> ...
user avatar
0 votes
1 answer
17 views

Views skip contextual filter IF current user is Administrator

I have a View that has a contextual filter that uses a token to get entity reference values on the current user to limit a view (that also points at the same reference type). If they match up, that is ...
user avatar
  • 26.8k
0 votes
0 answers
9 views

Search Api/Views filter can't disable search on enter

I have a view of nodes. I am using search api, and added the exposed filter to the view. And using ajax to update some content on the page depending on the search result. However, if the user presses ...
user avatar
0 votes
1 answer
14 views

Sort nodes based on parent taxonomy term name in views

I have a taxonomy term "Store Locations". I have added terms as State & City by parent child concept. Like this: I have created Store Locations as node and assign them in the taxonomy ...
user avatar
-5 votes
1 answer
48 views

How do I execute PHP code in a view?

There are myriad applications to need to execute specific PHP functions in Views rows. In many cases, making a custom Plugin is a better option. In other cases, it's better to use a Twig or custom ...
user avatar
-1 votes
1 answer
23 views

Why the view block under the search field was not rendered?

I created a block based on the view with machine name search_entity_product_block: Then I created a custom form with method someMethod which should render a block of the view below the search field: ...
user avatar
  • 11
-3 votes
0 answers
14 views

List encrypted user emails in Views

I want to create a View that lists user email addresses along with the node info. This is a REST Export View that is built with the RESTful Web Services module and Views Data Export module. The ...
user avatar
  • 550
0 votes
0 answers
17 views

Migrating contextual PHP validation code

I have custom PHP in my Drupal 7 views page. But migrating to Drupal 9 isn't an easy task as the Views PHP isn't used anymore and require Views Plugins. But I'm not sure where to start as there are so ...
user avatar
0 votes
1 answer
48 views

How to move the attachment of a view, in a region?

The question is simple, I have a Drupal 9 website with the Geolocation Field module. I use the Olivero theme. In this theme, there is a "Hero (full width)" region. I want to display a View ...
user avatar
0 votes
0 answers
22 views

Why are facets not displayed on pages?

I have two entities: Entity Product and Entity Product Category. Entity Product has an entity reference field on the Entity Product Category. Goal: Display categories and their number on the right by ...
user avatar
  • 11
0 votes
2 answers
64 views

Custom entity integration

I have created an entity, contactdata, and am trying to expose this entity to views. I have created my own views_data handler class, contactdataEntityViewsData, and have annotated my custom entity to ...
user avatar
0 votes
0 answers
7 views

how to name template commerce-price-calculated.html for a specific view

I'm using Drupal 9.4 with commerce 2.30. To display both base-price & calculated-price, I've create a template commerce-price-calculated.html in web/themes/custom/mytheme/templates I have a view ...
user avatar
0 votes
0 answers
39 views

Why does our Views Block not get updates with node updates until we force Clear all Cache?

We have a View of nodes with two displays. The first is Slick Carousel block that shows some slides (images from nodes) and another display that is a Page used for drag and drop sorting (using ...
user avatar
1 vote
2 answers
34 views

Make views output more dynamic with knockout.js or other similar framework?

I am currently experimenting with knockout.js so i can make views output more dynamic. I know React and angular among other newer frameworks are recommended but i do not want to create single page ...
user avatar
0 votes
0 answers
24 views

Field rewrite results: URL token

Views / configure field / rewrite results says: The text to display for this field. You may enter data from this view as per the "Replacement patterns" below. You may include Twig or the ...
user avatar
  • 335
0 votes
0 answers
16 views

How to make custom Views filter plugin dependent on the values of anotherr filter value?

I have created a custom Views filter plugin that filters the node according to nid. This is available as a dropdown plugin. There is another custom Views filter available as dropdown. The value of the ...
user avatar
  • 814
1 vote
1 answer
17 views

Views SQL query not showing in production

I don't see any of my data from my view on my production website. I'd like to compare the data generated in the view compared to my local (which is working fine). But in my production website, I don't ...
user avatar
  • 57
1 vote
1 answer
25 views

How to show terms with a specific depth as exposed filter

I would like, on Drupal 9, to show in a view as exposed filter a taxonomy term with depth 0, one with level one (the children) and one with level 2 (level one's children). Basically I have a content ...
user avatar
  • 103
0 votes
1 answer
50 views

Proactively rebuild view cache

I have a view that takes a while to build when the cache is cold (around 11s). When the cache is hot, the view loads quickly, of course (around 100ms). I'm using tag-based caching for this view, so ...
user avatar
0 votes
1 answer
36 views

How do I override the template file of a view so that it no longer displays links in my view, but only the plain text?

How do I override the template file of a view so that it no longer displays links in my view, but only the plain text? This is a body field where the titles of the refenced entities are displayed as ...
user avatar
1 vote
0 answers
9 views

How do I make an exposed drop-down filter filter on a grouped set of date fields?

We have a Drupal 9 View of nodes that have a date field. The node dates will all be for a particular day for one specific week (for an event). We have the View formatted set to group the dates and ...
user avatar
0 votes
0 answers
6 views

Group rows by date

In a custom view, I have some values which belong to the same month (06/2022). If I have some other data, they will be also displayed (before or after the 06/2022) How can I change the configuration ...
user avatar
  • 57
0 votes
1 answer
34 views

How to render a custom block with variables from another custom block twig template

I have a custom block with some values I can access in the template of that block, for example the product_type variable. In the same template file I'm adding another view block with {{ drupal_block('...
user avatar
1 vote
0 answers
30 views

When I add a particular field, the preview disappears. Why?

I have a Drupal 9 view which shows the fields of a particular content type. This content type has a particular field, ver. When I add this field in the view, the preview disappears and I get this ...
user avatar
0 votes
0 answers
13 views

Grouped Date Filter - Offsetting by time of day

So I have a date field in an Order content type, and a view including an exposed grouped filter for a Date with buttons for early morning, mid-morning, noon, etc. I need to modify this filter so that ...
user avatar
0 votes
0 answers
28 views

How do I create a block that displays nodes related to the current page?

I have a taxonomy vocabulary (Tags) with the following terms. term 1 term 2 term 3 term 4 term 5 term 6 term 7 term 8 term 9 term 10 term 11 term 12 term 13 term 14 term 15 term 16 I have an ...
user avatar
  • 11
0 votes
0 answers
22 views

Views: querying several fields and presenting aggregate values

I have a need to build a report that aggregates field values using sum and count. I am running into trouble though figuring out how to solve rows that don't map at a field. For one, the table headers (...
user avatar
  • 26.8k
0 votes
0 answers
18 views

How to get the multiple fields values update in one field on view page

i am creating one preprocess_views_view_field for specifc one field.I have 2 fields file name and news link. while need to change or get the those values are pass to field_link_text. I cant achive it ...
user avatar
0 votes
0 answers
52 views

How to display nodes that belong to the same taxonomy term as the current page?

I created a "Categories" taxonomy vocabulary with the following terms and child terms : - Crypto -- Binance -- Ledger -- Metamask - Geek -- Security -- Apple ... The "tags" ...
user avatar
  • 25
0 votes
0 answers
22 views

Programatically added custom fields don't show up

I'm adding new fields to views through a custom module. When I open the view page UI, the field is not shown. However, If I edit the view from the user interface, and click on Add field, the custom ...
user avatar
  • 321
0 votes
1 answer
19 views

Add custom actions

In our website, I created a webform to allow users to ask for permission to purchase items; then, I created a view to show a table of records with the values in the fields contained in the webform ...
user avatar
1 vote
1 answer
28 views

Persist query string arguments across all links in a particular menu?

I have a menu "Display Style Switcher" which has two links: Map, and List. You click Map, you get the Map display of search results, and if you click List you get the list display of search ...
user avatar

1
2 3 4 5
302