Questions tagged [views]

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

4,849 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
1answer
470 views

Order list: Pay unpaid invoices

I have created some extra statuses: Paid and Unpaid. Now they got the functionality and react on the transaction balance perfectly fine. However, on the user site, it is kind of a dumb thing. Even ...
6
votes
1answer
494 views

Grouped Exposed filters radio buttons : one in two no value ticked. How to programatically force default button be ticked?

Some exposed filters (radio buttons) aren't systematically ticked when a view is displayed, causing an "An illegal choice has been detected. Please contact admin..." error message and No result found. ...
6
votes
2answers
2k views

Reasons for subsequent Broken/missing handler in Views?

In the process of upgrading Drupal 6.x to 7.x I'm facing a problem that makes all my views show nothing relevant. (I believe the problem is here but I'm not sure, I don't know. That's why I'm asking): ...
6
votes
3answers
657 views

Why Content Path cannot be used to sort a view?

Using Views with Drupal 7, how can I use the content path to sort a result table? I have node title, created date and path as fields for a view. The first two fields have the checkbox to make them ...
5
votes
1answer
83 views

After implementing hook_node_access, how to stop node from appearing in view?

In Drupal 8, I implemented a hook_node_access function in my module to control access for a certain role under certain conditions and it works fine. However, all of that content type are still shown ...
5
votes
0answers
201 views

How to use Context with Views' Contextual Filters

I have content type City. I have a view page with contextual filters to show the cities at the URL pattern locations/<city id>. I want to use Context to add blocks to these cities pages but I ...
5
votes
1answer
675 views

Change views exposed filter format

I am build a JSON export using a View in Drupal 8. Problem is that the parameters for retrieving the json doesn't seem to work as I would want. In my View I need use two exposed filter criteria to ...
5
votes
1answer
820 views

How to add multiple products to cart at the same time with attributes

I have different view blocks that display multiple products on the same page, each product has their own attributes such as product bundle and custom line item, these serves as an option set / ...
5
votes
1answer
299 views

Search filter result score

I'm seeing an interesting anomaly (?) I'm trying to get to the bottom of. I've set up a view with an exposed filter Search: Search Terms. I am trying to mimic the result set offered by standard drupal ...
5
votes
1answer
2k views

jquery date picker in views exposed filter changes the date values

I have a node type "tasks" and created a view so that current logged in user can see his/her assigned tasks. I have used a "time ago" formatter in the field "deadline" which shows the remaining time ...
5
votes
1answer
132 views

Letting a view know in which pane it's being displayed

I've got a very non-trivial question on integrating Panels and Views. Maybe there's no solution out of the box, but I would really appreciate any help. Essentially, I've got a lot of tagged nodes. ...
5
votes
1answer
947 views

Database table cache_views_data is extreme large, what size is normal?

I have a Drupal 7 site with ~70,000 nodes and ~500,000 terms. During some investigations for the cause of substantial performance problems, I found out that the database table cache_views_data is ...
5
votes
2answers
1k views

Views not showing date field in proper time zone

I created a node type with a date field (from the date module). I list nodes of this type in a view. The problem I have is that the date values being shown by the view are in UTC (ie as they are ...
5
votes
2answers
1k views

Passing dates or date ranges into a view as arguments

Drupal 7, Views and Date modules installed. I have a view on a content type with a date field (timestamp, but I can change it if necessary) When I use it in filter criteria, I have no problem to use ...
4
votes
0answers
343 views

Custom views filter for custom view field

I want to created a custom views field, following this tutorial: https://www.webomelette.com/creating-custom-views-field-drupal-8. This custom field counts and returns the number of referencing ...
4
votes
1answer
75 views

How to get a second join into hook_views_data?

I am trying to make the value of a string (name) found in mymodule_names.name available to Views by means of hook_views_data(). To get the name, I need to first look up the nid of the node I want ...
4
votes
1answer
860 views

What is the difference between a JOIN and a RELATIONSHIP in hook_views_data_alter()

What is the difference between these two as implemented on hook_views_data_alter()? Why choose one over the other? I did notice that in setting up a relationship between mytable1 and users tables, ...
4
votes
1answer
620 views

How do I remove JOIN in hook_views_query_alter()?

I have a view with two filters (A + B). Filter B should only be included in the query, if a specific value in filter A is set (like a "conditional filter"). So I tried to remove the where condition ...
4
votes
0answers
929 views

How to create a Draft view with Content Moderation?

In Drupal 7 with Workbench Moderation is easy to create a view to show the last Draft of a content: You have a relation in the view named Workbench Moderation: Node, so using the filter Workbench ...
4
votes
0answers
344 views

Views doesn't like multiple entity references in my entity

I have a couple of custom entities defined by my module against plain tables in my database (because I have a lot of data and don't want to unpack it all into fields). My contact entity has a ...
4
votes
1answer
2k views

View for Taxonomy terms?

How can I output nodes which linked with taxonomy term through a view? How can I link taxonomy vocabulary with a view wich will output appropriate nodes for each term of this vocabulary? In Drupal 7 ...
4
votes
0answers
394 views

View exposed filter block no alter form with ajax

I am trying to filter out the no results items in my exposed filters. (I know i can use selective filters, but in this case i can't use them). So i alter the filters with form_alter, check which ...
4
votes
1answer
93 views

Alter the exposed filters of a view, based on the view result

I have a view that displays matching nodes, based on contextual arguments. I'd like to create an exposed filter that filters by node title, displaying a drop down (select) menu with options for every ...
4
votes
1answer
57 views

Exposed filter : search term with select which 'field' to search by

I have a view which displays a list of nodes with exposed filters. Everything works perfectly. I would like to add a filter like this: one input text one drop-down. The list items represent fields ...
4
votes
1answer
667 views

Using multiple AND/OR operators in contextual filters

I'm trying to query my nodes by using a contextual filter in views, however, I am unable to use multiple AND (+) operators and OR (-) operators at the same time. For example: This works: mysite.com/...
4
votes
0answers
1k views

Search excerpt with Search API (rendered HTML)

Is it possible to create a search excerpt from the Entity HTML Output (with Search API)? What I did: Activated highlighting and "create excerpt" within my Search index. Added "complete entity view" ...
4
votes
1answer
545 views

Wrong timezone in Views output

I'm using Services Views to create a JSON output of my Drupal site's nodes. These nodes has a start and stop date and time regarding an event. On the site, viewing the node, the time is correct, but ...
4
votes
2answers
2k views

Programmatically modifying global custom text field in view

I have a (Apache solr) view with a Global: Custom text field in addition to my normal fields. This field is meant to get value from a custom function/existing field/passing an existing field to a ...
4
votes
1answer
500 views

Use image from taxonomy term as exposed filter option

I created a view which has an exposed filter for taxonomy terms. Now the next step is to theme the options. I tried the module "Better exposed Filters" but I wasn't satisfied. I would like to have ...
4
votes
1answer
1k views

Alter granularity in date exposed filter from Y-m to Y if only year is selected

I am trying desperately to get the following working: Goal: I have a views that displays a list of events. To this views is a date exposed filter attached, with granularity Y-m(year month). I want ...
4
votes
1answer
300 views

How to link a view to the current language with a no results fallback to the default language?

I've already figured out how to link views to content language by the Content: Language filter. I know that I can create a second view to use as the No Results fallback and use the Global: View area ...
4
votes
2answers
3k views

Using Media, views, and colorbox to create a image gallery

Currently I am running in D7 with the following modules: Media 7.x-2.0 Views 7.x-3.7 Colorbox 7.x-2.4 I am trying to create an image gallery using these modules with the following steps. Please ...
4
votes
2answers
994 views

Display a grid view without border columns

I'm trying to display a specific number of products in a e-commerce drupal site in the front page. I would like to use a display as in my theme's demo : http://demo.morethanthemes.com/tophit/ I ...
4
votes
1answer
935 views

Using a View in a tooltip for an image map hover link

I have a imagemap with various tags, it works well in my Drupal instance, I can click on the various areas to get to my pages. Now I want to hover one area and display a tooltip with information ...
4
votes
3answers
906 views

Get field_collection values in field template

I have installed field_collection and have a collection called field_contact, each entry of which has a field called field_contact_url I'm trying to customise the display of that field by overriding ...
4
votes
2answers
545 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 ...
4
votes
1answer
156 views

Grouped exposed filter is not available

I'm trying to create a filter within a view, which has multiple ranges; i.e. 0-99 100-399 400-699 700-1000 I have seen this before when you Add filter criteria, you can select grouped exposed ...
4
votes
1answer
407 views

“Page not found” on translated page

I’m setting up a dual language site (English default / Chinese, Simplified) where Taxonomy translation mode is “Localize”. I modified the Taxonomy term in Views. I get results with preview in both ...
4
votes
2answers
154 views

View statistics with colorbox module

So I'm building a community website for a local photography group and I'm trying to set up a "well equiped" group photo grallery that registered members can upload photos to. The gallery should ...
4
votes
1answer
74 views

How to include any view into the same panel

To reduce duplicated panel pages for every view I want to display, I'd like to re-use the same panel (the same layout) for several views. The problem is that I can't find how to include ANY view in ...
4
votes
1answer
163 views

How can I automatically add a comment to a node with rules

Can someone help me with this? I have created a view that gives me a table of certain fields. Now I would like to add a "bulk operation" that lets users add an automatic comment to that specific node....
4
votes
3answers
826 views

User contributed image gallery, per node

Working on a new Drupal 7 based site. Put together a few sites back in the 5 days, but lots has changed. I'm looking to allow users to upload images to a particular content type, and to show those ...
4
votes
2answers
4k views

How to translate taxonomy terms displayed via an exposed filter in views?

I'm using the Views, i18nviews, and Entity Translation modules. All of my terms have already been translated using Entity Translation. In views displays, the translated terms appear in the correct ...
4
votes
1answer
81 views

How to perform bulk operations on a view when the view is displayed but without the need to select rows?

I would like to execute certain Rules based bulk operations on a view (using the VBO module). But not the way they are normally done when using VBO, i.e selecting the rows in the view and then ...
4
votes
1answer
978 views

Using Entity reference + Views to create members select list

How can I use VIEWS + ENTITY REFERENCE to get list of active members specific to the CURRENT GROUP [created via organic groups]. I have created a view that list active members belonging to the group....
4
votes
1answer
593 views

Hide an entire View Block when query returns no data

I have a view block and - because of the filters being applied - it may show data or may not. If the view's query returns no results, I need to hide the entire block - the .block - not just the .view ...
4
votes
2answers
535 views

How to set Permission based on roles for Views Data Export

Using views data export module, I set the permission for different roles in the Data Export in Views like: But I can still see the Export button for all users in front page. However if the role doesn'...
3
votes
0answers
350 views

How to change the title of a modal window?

I have a link that displays a modal window. The link redirects to a page view. When I click on it, it is marked in the title of the modal window Array. How to customize the title ? <?php ...
3
votes
0answers
120 views

How to set the correct RSS row plugin?

I need to add an image to the RSS feed. So I create a new row plugin for the RSS and it extends RssFields row plugin. /** * Renders an RSS item based on fields. * * @ViewsRow( * id = "...
3
votes
0answers
683 views

Custom view sorting plugin / handler

I am trying to create a custom sorting option for view that will sort result on the basis of percentage of 2 fields. field 1 = node__field_funding_amount field 2 = node__field_funding_goal and i am ...