Questions tagged [views]

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

5,142 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
2 answers
855 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. ...
Kojo's user avatar
  • 3,523
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 ...
cellear's user avatar
  • 81
8 votes
1 answer
503 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 ...
user6958's user avatar
6 votes
0 answers
1k 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 ...
Adrian Cid Almaguer's user avatar
6 votes
1 answer
1k 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 / ...
Danz's user avatar
  • 439
5 votes
1 answer
206 views

How does the Geolocation content of a page filter is a Views block?

I have a website with Drupal 9 and the Geolocation module : https://www.drupal.org/project/geolocation I created a content type with a Geolocation field that contains coordinates. My website uses the ...
zoulou66's user avatar
5 votes
2 answers
181 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 ...
Nic Rodgers's user avatar
5 votes
0 answers
986 views

Show nodes of other content type that share a common term (with depth)

I have two content types: sector and product. Both share terms from the same vocabulary, called branch. A sector node should list all product nodes that share the same term(s) (from the branch ...
cptstarling's user avatar
5 votes
1 answer
370 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 ...
Daniel Rogers's user avatar
5 votes
1 answer
1k 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/...
JavaScript_Guru's user avatar
5 votes
0 answers
2k 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" ...
ash's user avatar
  • 71
5 votes
1 answer
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 ...
Najam's user avatar
  • 51
5 votes
1 answer
152 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. ...
Mark's user avatar
  • 71
5 votes
1 answer
1k 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 ...
user5950's user avatar
  • 2,018
5 votes
1 answer
177 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 ...
Rob's user avatar
  • 341
5 votes
3 answers
974 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 ...
Gueno's user avatar
  • 391
5 votes
2 answers
2k 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 ...
user1750's user avatar
  • 1,276
5 votes
2 answers
2k 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 ...
user1014351's user avatar
5 votes
2 answers
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 ...
Patrick Kenny's user avatar
5 votes
1 answer
1k 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 ...
Jeff's user avatar
  • 283
4 votes
0 answers
283 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 ...
Jeff's user avatar
  • 283
4 votes
0 answers
3k views

"DISTINCT" in Views not applying?

I am trying to add DISTINCT to a view, and for example I chose the default content view. I expect that it would add DISTINCT(id), but the query does not change at all. Why is it not added? Update: ...
Kevin's user avatar
  • 27.8k
4 votes
1 answer
704 views

Custom views filter on computed field

I've built a custom field into the view which displays the menu name a node is assigned to, but I want to filter on the menu name. How can you filter on this computed field? The only examples I have ...
Dylan Spencer James's user avatar
4 votes
0 answers
318 views

How to hide a menu item of a view for an administrator?

I have created a view with Views and restricted the access by Role. I also created a menu with the view, and I didn't select the Administrator role to be included (so Administrator role does not have ...
usethe23's user avatar
  • 651
4 votes
2 answers
1k 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 ...
Philipp Michael's user avatar
4 votes
0 answers
494 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 ...
mgoubert's user avatar
  • 365
4 votes
1 answer
99 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 ...
N.Faget's user avatar
  • 41
4 votes
1 answer
732 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 ...
Daniel Holm's user avatar
4 votes
1 answer
940 views

How to use url alias in views for taxonomy terms?

On a Drupal 7 site with pathauto installed I'm using a view to show all taxonomy terms of a given node. The terms are linked to the term's page. The problem is, that the path of those terms does not ...
user5950's user avatar
  • 2,018
4 votes
2 answers
4k 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 ...
optimusprime619's user avatar
4 votes
2 answers
2k 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 ...
walidvb's user avatar
  • 141
4 votes
1 answer
431 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 ...
Robert K's user avatar
  • 141
4 votes
2 answers
3k views

How can I create an 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 ...
otc61686's user avatar
4 votes
2 answers
1k 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 ...
KLaz's user avatar
  • 151
4 votes
1 answer
1k 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 ...
Marcandria's user avatar
4 votes
3 answers
1k 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 ...
ChrisJ's user avatar
  • 203
4 votes
2 answers
951 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 ...
Dorothy Parkour's user avatar
4 votes
1 answer
426 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 ...
Jessica K's user avatar
  • 126
4 votes
2 answers
163 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 ...
Calvin Digital's user avatar
4 votes
3 answers
2k views

Different view page based on taxonomy depth?

I'm wondering if there is a way to show a different view (or view part) based on the current depth of the term level? Example I have a bunch of categories and subcategories. For the categories I want ...
Steven's user avatar
  • 1,244
4 votes
1 answer
79 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 ...
Normunds's user avatar
4 votes
3 answers
845 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 ...
Laizer's user avatar
  • 141
4 votes
1 answer
994 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....
EnergyBlazar's user avatar
4 votes
2 answers
642 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'...
user avatar
3 votes
0 answers
78 views

How to add views aware configuration options to a field formatter?

There is a contrib field formatter module (bg_img_formatter) which has numerous field configuration options. One of these options is a text field which needs to allow for the same views field ...
liquidcms's user avatar
  • 1,248
3 votes
0 answers
58 views

Can you rename replacement pattern tokens in views?

If you insert one or more custom text field (e.g. to include some Twig logic), latter fields will see such blocks as {{ nothing }}, {{ nothing_1 }} etc. in the replacement patterns. Can these be ...
William Turrell's user avatar
3 votes
0 answers
95 views

How efficient is views_get_view_result?

I am not a fan of writing long SQL queries and I am a huge fan of Views. When I need a list of nodes, for example for processing nodes in a cron task, I create a view and use views_get_view_result() ...
liquidcms's user avatar
  • 1,248
3 votes
1 answer
684 views

Sorting a view on a taxonomy term with entityqueue

I'm trying to use an entity queue on a taxonomy to create a new sort order for an existing view. But I'm having trouble configuring it. I've created a dummy website with a fantasy role-playing game ...
user1359's user avatar
  • 3,909
3 votes
0 answers
863 views

Pass Exposed Filter in Url / Link to Views page with AJAX

I have a Views with page display of field sets on url www.foobar.com/specialview Contains a number of exposed filters with AJAX. - works great. One of those fields I'm 'Rewrite Results' to a custom ...
piet's user avatar
  • 156
3 votes
0 answers
3k views

Drupal 8 creating a custom Views filter plugin

I am trying to create a custom Views filter plugin. Basically it should read the current path, check the relevant path field in the node (defined as text-field) and get that content. I'm stuck around ...
Tshwarelo's user avatar
  • 161

1
2 3 4 5
103