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

Select several pdf anywhere on website to add to cart and download them all by providing email

I use drupal 8. I have been searching all over the internet for a solution, but I cannot find any. This is my last resort before quitting on drupal and trying another CMS. I have a website (not an e-...
0
votes
0answers
5 views

Hiding view filter option based on another filter selection - Drupal

I have a view with search criteria and the search criteria looks like below: Age group(options: new born, toddler, pre-school) Classroom (options: NA, potty-trained, transition, not-trained) All ...
-5
votes
0answers
19 views

How we can display the last 10 of most popular articles on the front end? [closed]

I want to display the last articles that have most total views, I did all what are in this blog https://www.drupal.org/docs/8/core/modules/statistics/statistics-module-overview But
0
votes
0answers
12 views

How to get replacement pattern for Search API's fulltext search in global text area header

In Drupal 7, I'm currently using the default core search, and a view for node search results. I have a global text to pull in the replacement pattern for the term that were searched for. I get the ...
1
vote
1answer
17 views

Views alter changes next row instead of current one

I have a view that is showing event content types. Users can apply for these events. I am using a hook to alter the 'view applicants' so I can show how many applications already excist. The ...
0
votes
0answers
9 views

Views Data Export - Exporting a Referenced Media Item's URL

I need to create an Export to CSV from a series of pieces of content. Each piece of content uses a media field that I am trying to reference. The rest of the fields export fine, but I am unable to ...
0
votes
1answer
18 views

Filter nodes by today's date

Following what described in Views filter criteria date field is greater than current date, I have used operator >= today with some success. I would like to create "future" nodes and they should be ...
-2
votes
0answers
13 views

How can I serach in “custom block” using Search Api? [closed]

I cannot search in custom block body. I'm using Search api in Drupal 8.4.4. when I serach for word in custom block , the search return 0 results. I don't know what should I do.
0
votes
1answer
16 views

PHP query in a view will cause website error

I'm using a global PHP query in a View to find out the count of membership users. The first query, that extracts the total number of users from the database works fine, but when I use the WHERE clause ...
0
votes
0answers
16 views

unknown Ajax call on custom views_exposed_filters while changing dropdown list

I have two exposed filters as select fields (County and District) using Hook_form_ID_alter. I'd like to alter the #options of District base on the County I selected to display related options. But ...
0
votes
0answers
22 views

get view id in hook_preprocess_html() drupal 8 [closed]

To get the view id in hook_preprocess_html() function hook_preprocess_html(&$variables) { $route = \Drupal::routeMatch()->getRouteObject(); if ($route) { $view_id = $route->...
0
votes
0answers
33 views

Print a taxonomy term and url D8 views template

I am totally new to drupal 8. I have used d7 and i am migrating now. I have setup a view with 4 articles. I have managed to print out in a custom views theme my title image url {% for row in ...
0
votes
0answers
10 views

Contextual filter for month and day

I have created a block that lists all the users () that are years old that same day. The problem is that when I want to add a contextual filter that compares the birth_date field with the current ...
-1
votes
0answers
23 views

Content “stream” with manual placements

We have a requirement for a new project: on the homepage there should be a infinite (load more button) "stream" / list of content teasers sorted by published date the complicated part: it should be ...
0
votes
1answer
73 views

hook_views_post_execute() don't work on AJAX View with exposed filters after 1st refresh

I have a View which returns 5 entities of the same type. AJAX - enabled, filters and exposed filters, all working fine. I need to add a new result, a user - defined entity, at the top of the View ...
0
votes
0answers
31 views

How to call rest api in Drupal8 After form submit

I created one internal api call as '/api/v1/user/promotional-emails' this api calls some external apis and we are updating data there. In postman api is working fine. Now i created a user form as '/...
0
votes
0answers
10 views

Are there any solutions that integrates custom mysql datetime field with views?

I created my own table with a mysql datetime field via hook_schema. The code that defined the field is here 'timestamp' => [ 'description' => 'The timestamp value when the recipient ...
-3
votes
0answers
17 views

Best way to create custom page with statistics [closed]

I would like to create some statistics: total number of registered users, total number of subscribers, total number of registered users online on website without paid membership and so on. I'm trying ...
0
votes
0answers
24 views

Setting Views contextual filter values dynamically with Twig in Webform

I am attempting to embed a view in a webform whose contextual filter value is set based on a user selection. I have created a view of nodes with a contextual filter, and a webform with a select ...
0
votes
0answers
6 views

Drupal 7, views, organic groups, how to create a view of groups user belongs to and what their role is

I have built a view following this link Using Views to List a Member's Organic Groups (7.x-2.3) It list the groups the current user has subscribed to. I have been trying to also add a field ...
0
votes
0answers
5 views

Display only the variations of a specific product when I create a new content

I'm working on a videogame website. I use Drupal Commerce with Druapl 8 to manage games. For example : (Sonic the Hedgehog) is the Product, and (Mega Drive - EUR) and (Mega Drive - JPN) are the ...
0
votes
1answer
15 views

How to get bundle machine name when viewing the creation form?

From the creation form (any bundle), I need to get the content type label/name to use it in a link (in a block, for example) and pre-filter the View opened by this link. Example : The user wants to ...
0
votes
0answers
11 views

Multistep sign up, force user to create node before they can access site?

Im using Drupal 7. I want my users to either create a node or flag a node before that can access the rest of the site. I have created a view of content, and added filter either current user is node ...
1
vote
1answer
20 views

Splitting exposed form filters amongst several blocks

I have a views search page in D8 where I'm I have exposed filters that are shown in blocks. I'm also using search facet blocks. What I want in the sidebar is the exposed filter text search field, ...
0
votes
0answers
17 views

Is it possible to alter a field value in a Views filter handler? [duplicate]

I have a custom Views filter handler where I need to alter the field value within it. The filter is for a date field in the table that uses a non-standard date format and I need to change the value ...
0
votes
0answers
10 views

Sort tags in a view by the number of content they are displayed in

I'm trying to make a view that would display only name of tags and the number of content that uses that tag. I have managed to do this following this tutorial: https://www.youtube.com/watch?v=...
0
votes
0answers
20 views

Custom entity's exposed node reference filter

I have created a custom Entity using drupal generate:entity:content. This works great overal: I can use it in my code like I want. One of the table columns of the entity is a node-reference. This ...
0
votes
1answer
32 views

how cache a view that has a field that is calculated on the fly

in a view, one field has the following computed value, which takes a lot of time to return results from the database: <?php $term = taxonomy_term_load($data->tid); print ...
0
votes
0answers
22 views

Create specific view for all categories

I have a list of Categories defined that all have specific URL aliases defined. I'm trying to set up views for those specific feeds. For example, if I have categories cats, dogs, fish (with aliases /...
0
votes
1answer
23 views

How do I rewrite the way my view rows are displayed

I created a view and added three fields. A title, a link, and an image. When adding the image, I set the formatter as URL to image. How do I rewrite my in my views so that each recipe can have the ...
-1
votes
1answer
25 views

Get all the paragraphs of the current node programmatically in form_views_exposed_form_alter

I have a content type with multiple field paragraph. I would like to get all the paragraphs from the current node in form_views_exposed_form_alter. I tried $node = menu_get_object(); $storage = ...
0
votes
3answers
45 views

Override templates for one view page or block

I am trying to figure out if there is a way to override the base templates for one view. I created a page with a view called 'Promotions'. I need to override the views-view-field.html.twig, views-view-...
0
votes
3answers
60 views

Programmatically add cache max-age

I tried setting the cache max-age to 0 in hook_views_pre_view, in hook_views_pre_build and in hook_views_query_alter but it just doesn't work. Eg: function my_module_views_pre_build(ViewExecutable $...
-3
votes
0answers
17 views

How to create filters for product fields in Ubercart?

I have installed ubercart module in drupal 8. I want to display filters on ubercart catalog page. Please help me How to add filters on ubercart catalog page.
0
votes
0answers
19 views

How do I create a template to display view fields [duplicate]

I created a view and added it as a block. Now what I want to do is to manage the way the fields are displayed. However, when I inspect the page, twig doesn't show me a template name that I can use to ...
1
vote
1answer
11 views

View page not filtering content according to its language

I used devel to generate dummy content for a content type named recipe, and at the moment I have 10 recipes. 5 in English and 5 in Portuguese. I create a view(page view) that shows all the recipes ...
0
votes
0answers
20 views

Views: how list all nodes that have the same value for a field

I have a website which with different content-types to present recipes. The content types are as follows: - Recipe, contains a field 'ingredients' linking to: - Ingredients, contains a field '...
0
votes
0answers
26 views

Group id not shown when view is empty in Drupal 8?

I am new to Drupal 8. I make custom view field (programmatically) and pass session variable to it.Session variable contain group id. The problem is that when the view is empty i mean no content in ...
0
votes
0answers
26 views

Make a news item “sticky at the top of lists”

I want to sort my news items by sticky to the top and then date so I can highlight certain news items. The same question was asked here, the answer was to: "Just sort by sticky and after that sort ...
0
votes
1answer
21 views

Show the title of the node from an entity reference

i have a content type, which has in it a field which is of type Entity Reference. I now have created a view, where i need to aggregate on the sum of records based on this field. But my problem is that ...
0
votes
0answers
19 views

View footer summary

I would like to add a footer to a view with a summary with some row calculations. I have tried creating a plugin (AreaPluginBase) but It doesn't give me the rows nor the arguments of de view. I've ...
0
votes
1answer
27 views

Returning from ajax callback ruins view

Currently I am hooking into the add to cart form on my website. I added ajax to the edit quantity buttons like : $form_quantity[$key]['#ajax'] = [ 'callback' => 'update_cart_order', ...
0
votes
1answer
31 views

How to use custom tokens in view header Drupal 8

I make custom token which i use in view filter but now i want to use in view header.The custom token doesn't show in view header Global: Unfiltered text (Global: Unfiltered text) or how i make "...
0
votes
0answers
38 views

How do I control which tabs a block is displayed in?

Drupal 8.8.1 with commerce 2 installed. Goal is to make better use of the ‘logged-in user’ landing page(My Account) by adding blocks of useful content. Blocks created using the UI as well as coded ...
0
votes
0answers
16 views

managed_file FormElement submitting form upon file upload

How do i prevent managed_file(Browse Button) from calling submitForm function upon uploading file? I've added '#attributes' => [ 'submit' => FALSE, 'onclick' => 'return false' ] to no ...
0
votes
0answers
18 views

How do I create a View to use Bootstrap Paragraph fields and group by the title?

I have a View for FAQ's, and an exposed combined fields filter. I created an FAQ content type, and added a paragraph field that contains "Question" and "Answer" fields. I cant use Search API, and want ...
-1
votes
0answers
10 views

Better Exposed Filters secondary option is shown collapsed on page load. It only does this when the proximity field is added. Why is that?

In views, I added a filter using the proximity field, and added this to the secondary option of the better exposed filters. However, the filter is always collapsed on load. With any other field it ...
0
votes
0answers
18 views

Rewrite field ampersand converts to &amp;

I have an URL field that I'm outputting in my Services Views endpoint and everything works perfectly until I add a query string. The aim is to add UTM parameters to my URL through the rewrite field. ...
1
vote
1answer
19 views

Custom exposed filter for year in date field with ajax

I am trying to create a custom exposed filter which would be a select field with years (2015-2025). This would filter the result with the year of the date they are created. I followed this tutorial ...
0
votes
2answers
65 views

Get the raw URL of an image in views-view-table.html.twig

In the views-view-table.html.twig template, I can get the raw values of fields by repeating on rows and accessing the view object. For example: {{ view.field.title.value(view.result[i]) }} {# ...

1
2 3 4 5
290