Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [views]

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

0
votes
2answers
436 views

Hide a view if there are no results

(Spin-off of Remove/Hide the block if the View is empty?. I find the other question a bit confusing, and want to reduce it to the essential question.) When rendering a view programmatically, and ...
1
vote
1answer
439 views

Sending email notifications to Webform submissions using Rules, Views and Webform

I am trying to create a rule that will send an email to a list of webform submissions, notifying them when new content is created. So far, here's what I have: Event: after saving new content of type [...
2
votes
1answer
439 views

Arrange formatted fields in Views row using a template

I want to render the rows of my “Recent content” Views page using a template in order to subdivide the rows into multiple divs, freely move around the rendered fields within these divs, and apply ...
1
vote
1answer
439 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 ...
2
votes
1answer
440 views

How can I return literal JSON from a node as a JSON object in views json?

I have a content type with a field called output. This field will contain JSON. I want to output this field as JSON using Views JSON (in Views Datasource). The problem I'm encountering is views ...
1
vote
1answer
446 views

Display content based on URL

I am working on Drupal 8. I have a to display content from a content type on different pages. I am trying to use Views to achieve this. In the content type I added a field to refer to Pages so that ...
3
votes
1answer
457 views

Two Views displays with one exposed filter

I have a view using one exposed form in a block with a couple exposed filters. I would like the same result set to be used in two displays that have a slightly different format. One of my exposed ...
2
votes
3answers
3k views

Views image not visible?

I'm using the Drupal Commerce module, and there is no "Latest products" block. I am trying to make a "Latest Products" view, but the images of the products are not visible in the view; however, the ...
0
votes
0answers
19 views

How to get field type of an object of Drupal\views\Plugin\views\field\EntityField

I want to filter the field type "links" out of my $handler: /** * Searches for the link field to use, if present. */ public function find_link_field() { foreach ($this->view->display_handler-&...
-1
votes
2answers
441 views

Is there a way to use views with existing associative data in large tables?

I have a large database with some tables having over 2M rows. I would like to know if Drupal Views can somehow connect to this table for CRUD operations so that I can gain all of the functionality of ...
-3
votes
0answers
33 views

How can I get the total visitors, unique visitors and node count year by year? [on hold]

How can i get the Total Visitors count, Unique Visitors count and Node Count and Published Nodes from site year by year. i.e 2016-2017, 2017-2018, How to get year by year count. I am using Visitors ...
3
votes
1answer
452 views

Multi Page Selection VBO

Is there a way to achieve multi-page selection. Everytime I go to the next page, my selection gets lost. Any chance to keep my selection over multiple pages?
0
votes
1answer
24 views

How do I display all terms of nodes created by user in a user view field

I have a User view where I list user information with contextual filter UID. I want to display all the terms from the nodes that the user added. I added the Author relationship so that way I can ...
1
vote
1answer
443 views

Get field from another content type in Views

I have two content types, 'user' content type where I have some info about user and then 'post' content type. Now I have a view that gets all 'posts' and shows them correctly but I would need to get ...
0
votes
2answers
472 views

How to theme individual Field in Views Drupal 7

I have views of ubercart products which are displayed in a table by standard drupal view standards. How can i theme individual product fields ? views-view-field.tpl is having the complete product ...
0
votes
1answer
444 views

Set pager none in a view programmatically

I want set pager none in a view programmatically, but I can not find a way to do it, the object "$view" does not seem to exhibit a way
0
votes
1answer
477 views

Location's Distance/Proximity exposed filter without Node Location Submodule but with Location CCK Submodule instead

I would like to stay a little bit more flexible and use Location CCK fields (from Location CCK Submodule) instead of Node Locations (from Node Locations submodule) on my nodes. However, in my view of ...
0
votes
0answers
17 views

Page title from the exposed filter term

I have a view that shows all the contents of my site, with an exposed filter, that allows to filter these contents according to different taxonomy terms. I would like the taxonomy term chosen via ...
3
votes
2answers
2k views

Contextual filter by taxonomy terms

I have a two taxonomy vocabulary labeled as "Region and Category". Also made this as entity reference to a custom content type. Now, I created a view of contents of "Business Page" and I want to ...
0
votes
2answers
453 views

product display image not showing drupal

I have a question about Drupal Commerce (I'm using Drupal 7). I've added a number of products and created a multi-product display for them. I added a product image (it's common for all these products) ...
0
votes
1answer
442 views

Views Custom Field Handlers tokens

I am using simple views custom field handler. And I would like to make list of custom tokens for this $data array I have. How could I do that? class custom_views_handler_field_hostname extends ...
0
votes
0answers
10 views

views: make entityform aware of contextual filter audience field

I have a og_group_ref audience field in each of my entityform. The question is, is there a way to make the entityform types checkboxes above aware of organic group context via the audience reference ...
0
votes
0answers
34 views

How can I use a Twig if statement in a View rewrite

How can I add a Views field rewrite using Twig that will display the moderation state only if the node is in draft state or review state? I tried the code below but it prints all of the moderation ...
2
votes
2answers
477 views

Show custom banner per page

Admin user wants to be able to upload image banners and select on which pages/nodes/views/panels to show it when visited (as a wide screen image banner above title). It means when creating the banner ...
0
votes
2answers
463 views

Need to display fields in a different format

I have following fields in my content type: Title: [some value] Year: [2011,2012,2013,2014,2014,2016] Volume: [01,02,03,04,05] Issue: [1,2,3,4,5] Description: [some text] And I want a output display ...
-1
votes
0answers
13 views

How do I build and deploy a set of files that are in markdown format into a view

I have a set of markdown files under sites/all directory. Something like sites/all/docs/. The docs folder has a .yml file (used to specify the structure of the documentation) and 2-3 other .md files. ...
0
votes
1answer
444 views

How to comment on image in colorbox (modal form)?

I have created view to display images and also user to display it in popup using Colorbox trigger in view. I want to allow users to comment on each individual image in modal form only. Just like ...
1
vote
2answers
14 views

Change Selectlist to Radio button

I creation a view with sort Criteria who sorting product the problem when i click in i save i see in page a selectlist but i want to change selectlist to radiobutton , ps: i create a ...
0
votes
1answer
461 views

Replacement pattern for one value of a multivalue field in views

Rewriting the results of a views field, I wonder if there is a way to use a replacement pattern for the first, second and third value of a multivalue field. In my case, as example: I have tried to ...
3
votes
1answer
452 views

Views Grouping field:Add Ordered class to Grouping row

I use Views and Grouping field to integrate my data. But i need each grouping row ordered. I want to override the views-view-grouping.tpl.php, and change the "view-grouping" class to "view-grouping-1"...
0
votes
1answer
453 views

What configuration is required to use date_views with a field?

I have a custom entity "referral" which is available for views: function mymodule_entity_info() { return array( 'referral' => array( 'label' => t('Referral'), 'controller ...
4
votes
2answers
472 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
1answer
459 views

How can I display the Google rich snippets when a view is on “Show: fields” and the panel enabled?

I am building a site using Drupal 7 and the schema.org module and the microdata module. The site is live on production server (and works good). When checking a url from my site site on the google ...
0
votes
0answers
14 views

How do you set Views Contextual Filters programmatically

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
1answer
450 views

Views - exposed date filter adds a timezone offset in query

In Drupal 8, when creating a view with an exposed filter on a Date field (which is in date only mode), the resulting query removes some hours based on my timezone. I'm in the UTC+2 timezone, so a ...
1
vote
1answer
451 views

How to alter node body content through Views pre render hook?

I have build the view to display node title and node body also I have applied combined fields filter which searches the keyword in title and body and returns the results. While rendering the contents ...
1
vote
0answers
455 views

How do I deliver variables to a theme function?

I'm struggling to complete my first Views display plugin. Currently I'm at a stage where the theming stuff is not working. function MYMODULE_theme($existing, $type, $theme, $path) { return array( ...
0
votes
1answer
461 views

How to filter a View by Year and Month with Summaries for each one

or How to remove the exception parameter of a View's contextual filter Hi, In Drupal 7 I have a View with two contextual filters (date field): /view-url/YEAR/MONTH When YEAR is the first argument ...
0
votes
1answer
463 views

Add a custom handler method to a view?

How can I add a custom handler method to a view ? For example, i add a custom handler in hook_views_query_alter like this: $this->view->addHandler('page_2', 'filter', 'node__field_subsidiary', ...
0
votes
1answer
35 views

How can I add a class to a view list item that has a moderation state of draft

I have a view that outputs a list of nodes for a menu. The view displays the title linked to the node. The View allows published nodes or nodes in the moderations states draft or review. How can I ...
4
votes
1answer
63 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
459 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 ...
0
votes
0answers
16 views

hook_views_data_alter to turn a text-titles body field content to “bold”

How it would look a hook_views_data_alter to turn a texts "body" content to "bold". This means adding an html code element to the content of the body. For example: "First name: is simply dummy text ...
0
votes
0answers
11 views

Custom text fields are rendered without style property in Views [duplicate]

I've created a custom text field to dispay content in a view. Contents are rendered without style="" property. This: <section class="header-image" style="background-image:url({{ field_image }});...
1
vote
1answer
42 views

Get node id from a grid view

I am new with D8 I have a view which lists some content about a specific content type. I made a plugin that permit to add a custom drop button for each view rows This button has to make some ...
1
vote
0answers
35 views

How can I render the output in a certain language in a Twig template?

I am trying to override the titles of the nodes on my view page for Drupal 8. As my whole website is in English, but only on one view page I need to fetch the french translation of the titles, without ...
1
vote
1answer
447 views

“Allow multiple values” vs “Allow multiple filter values to work together”

In Views, when adding an Argument for a vocabulary term id, I'm presented with the following 2 options: Allow multiple values If selected, users can enter multiple values in the form of 1+2+3 (for OR)...
0
votes
2answers
17 views

How to get programatically 'display_options' for a specific page in Views

I am a bit confused on how I should code this... I have a view based on a custom content entity with 4 displays: default (hidden), Page (page_1), Export Entité (rest_export_1) and Export pour Maps (...
1
vote
1answer
450 views

Views, Taxonomy, multiple parameters using contextual filters

A view has been created to display related content types via their taxonomy terms, using contextual filters. Currently the view is able to display content based on the first param eg. about The goal ...
0
votes
1answer
468 views

Multiple pagers in one page

I have a view with two separate displays that is used in one single page. Both the displays are using a pager. To get things working I set a unique id for each pager under pager options. This works ...