Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
338 views

How to redirect to content if view have 1 result?

Views page show content. How to redirect to content page if views has only one result?
3 votes
2 answers
562 views

How to remove markup from file field

I have added a file field in views and when displaying it has some markup like this <div id="file-218" class="file file-image file-image-jpeg contextual-links-region"> <a href="#"> ...
0 votes
1 answer
663 views

Views hook_views_data add multiple joins to custom table based on row condition

I'm using hook_views_data to add a custom table and its fields to Views. The table relates to nodes, and looks like this: + node id | my_value | time_period + |-----------|------------|----------...
0 votes
1 answer
545 views

Alter the path of the more link from Views

In Drupal 8 how do I alter the more link? I need to give it a path which is based on a taxonomy id that is based on the current path (where the view is on) which has the taxonomy name in the path. ...
0 votes
1 answer
674 views

Multiple independent Views attachment pagers (load more)

I have a view with two attachments. I want to have a load more button to load items for each attachment and the main view separately, I have the load more module, but it loads more items for all the ...
0 votes
1 answer
647 views

Get the views field value

How to get the views field value and make a condition base on that field. Let say may views field is 'field_state' Example below: function my_module_views_pre_render(ViewExecutable $view) { //...
2 votes
2 answers
430 views

How can I set a view not to use the path previously set and be able to save the view?

I have some views I am not currently using. I want to disable the path, or leave it as No path is set. All I get is the following message. Display "VIEW" uses a path but the path is ...
0 votes
1 answer
633 views

Get the user's current language code

How can I get the user's current language code in a view as a raw value, for example en or fr-ca? This isn't for filtering content. I need the raw value of the users' current language to pass into a ...
1 vote
1 answer
542 views

How do I create a custom view filter for an existing field?

I ran into a problem with creating a custom view filter for an existing field for Drupal 8. I mean a filter not for fields like "nid", "title" and so on, but for fields, which were named CCK-fields ...
-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 ...
2 votes
1 answer
682 views

How to display parent Taxonomy ID in REST export

I want to configure REST export View in which I display taxonomy term name, id and parent ID. How to insert parent taxonomy term id, why it's not available in FIELDS? Here is current REST export ...
1 vote
1 answer
8k views

How to display menu in view Block in drupal 7

I am creating a website in which i am trying to display the submenu into view block . how can i do this. menu is Like A -B-c D -E-F I have to display in block view like This is view block B C | ...
2 votes
1 answer
410 views

Better exposed fiters with Views: how to show quantity of nodes tagged with certain term?

I use better exposed filters with views. I chose to show field "term reference" as hierarchical checkboxes on my exposed filter. It works great. But now I need to add quantity of nodes having certain ...
0 votes
1 answer
438 views

Set node to flagged by default

I'm using flags on my site as a way of filtering content through views, when a user views a certain node content type, I have a rule setup which resets the value of my flag and sets it against that ...
8 votes
2 answers
2k views

Paging a view based on a grouping field?

I'm upgrading a site I created 2 years ago from D6 to D7. In that site, I have a view of items that are grouped according to year, so that the items for each year show up on a separate page -- you ...
1 vote
1 answer
519 views

Views Bulk Operations skip confirmation

I have defined a custom action for a VBO. function expense_action_info() { return [ 'expense_finalize_action' => [ 'type' => 'node', 'label' => t('Approve and finalize ...
1 vote
1 answer
795 views

How do I filter the current year?

Initially, I have installed the Token module and created a Views block containing years. I want to filter out the current year from the block (it should not show the current year). In filter ...
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 ...
0 votes
1 answer
564 views

Views Bulk Operations with Field Collection Item tokens

I am trying to modify the values of one field in all instances of a field collection type. I have a view listing all field collection items, that I want and an operation field with modify entity. ...
1 vote
3 answers
5k views

How do I programmatically set contextual filters?

I need to set a contextual filter programmatically and almost every view I have will have this filter. However, some wont and will have other contextual filters instead. I have tried following the ...
0 votes
1 answer
454 views

How to use Views Page + Attachment to show parent and children nodes?

I have a site with a node type Lesson, which has a Category field that points to a taxonomy term. There is another node type Exercise which is a child to a Lesson node. I previously figured out how ...
0 votes
1 answer
514 views

Hide the "view exposed filter" form or reload the page after submit the form?

I am using view exposed filter on a view display as "block". The block is added to dashboard. I added a second function to "Apply" button using hook_form_alter. I want to hide the expose form of view ...
0 votes
1 answer
405 views

Views pager labels translation per context

Now that I finally have managed to have Views pagers appear, I'm wondering how I could change the strings collection (prev, next, first, last...) per View. That's because in a View that displays items ...
0 votes
1 answer
648 views

Wrapping fields together in a Views Exposed Filter

I'm trying to insert divs (or any tag) in my exposed filter form with the purpose of grouping related fields together. I want to have something like this: <div class="my-group"> field one ...
0 votes
1 answer
496 views

Add cardinality_unlimited taxonomy reference to custom entity

Okay, so I'm getting an error that I think may be a Views bug, but I don't have enough knowledge about Views & SQL right now to be sure about that. Here's the hook I'm using to install the new ...
0 votes
1 answer
378 views

Views Exposed Filter Sort on Entity based on Term Reference Field from Entity Reference Relationship

I've been playing around with Views exposed filters on an entity. I have so far been able to create a relationship to another entity through an Entity Reference, and exposed the fields belonging to ...
1 vote
1 answer
385 views

On View Rewrite Results I don't see additional options like Add Read More button when checked "Trim this field to a maximum length"

Can anyone help me? Because earlier this options were displayed when I checked "Trim this field to a maximum length". May be it depends on some settings? I can't upload image to show you what I mean. ...
1 vote
1 answer
597 views

Is it possible to get the last number of a views pager to display after and before the elipses?

I'm trying to create a custom pager similar to the Amazon pager: < 1 2 3 4 ... 82 > and after a certain point: < 1 ... 7 8 9 10 ... 82 > But, I cant figure out how to display the last ...
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). ...
0 votes
3 answers
722 views

displaying taxonomy term as a header in a view

I have a view that displays 3 latest articles from a certain taxonomy term. The issue im having is I need to display the taxonomy term as a Header. I dont see the [field_myterm] under Header > Global :...
1 vote
1 answer
436 views

Clean url for custom query parameters

I have a custom filter form in my site and the form submitted by the filters adds 2 Get variables to the url. However, the variables appear in the form of: http://example.com/newpage?param1=a%2Cb&...
0 votes
1 answer
739 views

Use contextual filter global null to pass values to override field result

I come again with new question about Drupal Views and i hope you can help and explain me how to achieve this, I made a page view to display all my content (this works fine) with the following path: /...
0 votes
1 answer
561 views

Views archive page showing year and months of article content type

I am trying to build a view page that shows archives (content type is article) only by dates: year (e.g.2016) february (post count) june (post count) etc .. year (e.g. 2017) march (post count) june (...
0 votes
1 answer
387 views

views to display list and related content on same page

I have created a veiws block which displays all the taxonomy terms of a particular type. This block is in left sidebar . Now what I want is ,"when i click on any of the term all nodes related to it ...
0 votes
2 answers
59 views

Pass one exposed filter onto another?

I have about a dozen string fields that contain objects and their states (for example, let's take 'AC_on' and 'heater_off'). And I have a view that shows nodes containing those fields. The task I'm ...
0 votes
1 answer
707 views

Twig Tokens in Views not Rendering Inside an HTML Element

I'm using views to create a custom block of shortcut icons and need the images to link to the corresponding content. Using Rewrite Results I can overwrite the output of the view and have an anchor tag ...
1 vote
2 answers
2k views

Is there a way to use grouping settings for Bootstrap Tabs in Views?

Is there a way to use grouping settings for Bootstrap Tabs in Views?
0 votes
1 answer
377 views

Views Pager, Can I change Items per page dynamically as provided input?

Is it possible to send Items per page limit in query string of view page url and get records according to that?
3 votes
1 answer
744 views

Is it possible to create a hierarchical exposed filter in views using the Data module?

I'm using Data module to adopt tables from the same DB as 'native' Drupal tables and Views module to present the data. I added two dropdown exposed filters with Selective filter module. It takes all ...
0 votes
1 answer
885 views

How to exclude nodes from views result?

I have a view with one field that shows rendered nodes, and a contextual filter (multiple values allowed) that provides the nids that should be used in the view. Each node (with nid from the context ...
0 votes
1 answer
3k views

Using a conditional OR in a view query alter programmatically

I am trying to use an conditional OR in my custom module. hook_views_query_alter(Drupal\Core\Database\Query\AlterableInterface $query) I get it to work with either one of these conditions set, but ...
0 votes
1 answer
424 views

How to execute a query taken from views in custom module

Please don't suggest query builder, this is the single query I need run from my custom module with passing arguments. I create a View with desire fields and copy/past the query in phpMyAdmin the ...
-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 ...
2 votes
1 answer
440 views

Views query alter but Views calc is not rendering right result

I am alter the views query with this <?php function cc_invoice_views_query_alter(&$view, &$query) { foreach ( $query->where[0]['clauses'] as $key => $value) { $explode = ...
1 vote
1 answer
452 views

Views Exposed filter Multiple times on a Page Or Different id for views exposed filter if added one more time

I added a views exposed filter to block and I want to show the block multiple times on the dashboard page each can have different choices. Can it possible without adding any other display? Or Can it ...
0 votes
1 answer
641 views

An error occured while attempting to process /ajax/ajax_facets/refresh:$.blockUI is not a function

Ajax facets work but I get an error "An error occured while attempting to process /ajax/ajax_facets/refresh:$.blockUI is not a function" when I click on ajax links with checkboxes for the facets for ...
4 votes
2 answers
849 views

Contextual filter with hierarchical taxonomy terms

Using contextual filters, I have created a view which shows a page of users at us/california, based on a taxonomy I have made of locations. This taxonomy is hierarchical, though, so when the user ...
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. ...
-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\...
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 ...

1
2 3 4 5
302