Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
17 views

View filter based in text not in number

I have a field in an entity that is an Entity Reference with widget Select list. I have created a view and I want to be able to filter by that field in text format, but when I try to configure the ...
1
vote
1answer
844 views

Term translations not working as View's path contextual filter

Let's say you have a taxonomy called Animals and you have terms like Dog, Cat, Horse, etc. Every term has its translation, so for example for dogs you have Hund and Chien. Now you want to make a View ...
3
votes
2answers
1k views

Related Content View with multiple Entity Reference Fields

I am trying to create a View to display related content based on shared taxonomy terms from multiple vocabularies. For example: I have two content types called Car and Parts. I have two ...
1
vote
3answers
1k views

programmatically change link URL in view

I have a view that shows all of a particular user's content (content the user has created on the site). This works fine, but I need to link the results (title field) to the pages where the content is ...
0
votes
1answer
854 views

Views PHP field: how to loop over result rows and return calculated values?

I cannot get proper results from View PHP field. I've set up a Flipped Table view of entity form submission of which I'm trying to calculate "results" (sum and count(for avg)) with following code $...
2
votes
3answers
2k views

How to programmatically select a view display in a view based on some node data

I have a content type that includes a field to store how that node should be displayed (display_option). display_option has two values (1|2). I have created a view with two displays. Both are pages. ...
3
votes
2answers
2k views

Exporting results with Views Data Export not working as intended

I have a view-based search (drupal 7, newest version of Views) with several exposed filters. By default it shows all results and users have to use the filters to narrow down their search. I've added '...
2
votes
2answers
2k views

Views Dropdown List of valid items

I'm looking to add an exposed filter that only contains existing user inputed value. For example. I've create a content type called 'Items'. Inside that content type there is a field called 'Team ...
2
votes
1answer
718 views

How to change date format in Views Calendar Pager?

I have multiple displays rendered in a Calendar View (Mo/Day/Upcoming/etc.) and everything's working as it should... except I changed a setting somewhere and applied it to all pages instead of current ...
0
votes
1answer
12 views

Select the same number of results for every group

I have views where I select nodes and group all results in 3 groups by field. When I select for example a limit to 30 I get results but with the different count in every group (for example 20/7/3). ...
0
votes
1answer
15 views

How can I use month name as contextual filter?

I have a contextual filter to filter by month: Date in the form of MM (01 - 12). However, I want to filter by month name (january, february, march, etc.) to get nicer URL and breadcrumb. Is there ...
0
votes
0answers
8 views

Change content of views_field_view field using hook_views_pre_render

I am using the views_view_field module for embedding a view inside another view. I want to concatenate some text with that field in hook_views_pre_render based on a condition. But when I printed the ...
6
votes
2answers
4k views

How to get contextual filter in hook_views_query_alter or hook_views_pre_execute?

I want to alter contextual filter before executing the sql query of views. Is there any way to get current contextual filter in hook_views_query_alter or hook_views_pre_execute? Or which is the better ...
1
vote
1answer
407 views

Override breadcrumbs is not present?

In Drupal 7, in the views with an argument, is easy to override both title and breadcrumbs. Now in Drupal 8 I can't find the option. Did I miss something? or isn't possible? In this case what is ...
1
vote
2answers
2k views

Taxonomy term node count with depth

I want to achieve the following term listing: clothing (17) dresses (2) skirts (3) tops (12) accessories (5) bags (1) jewelery (4) necklaces (2) rings (2) Is this possible with views? I know you ...
0
votes
0answers
20 views

How to extend ArgumentPluginBase and have it recognized by Views?

I'm wanting to create a Views argument plugin that extends ArgumentPluginBase in order to overrides one of the form elements in the buildOptionsForm(). I've pasted my plugin below. However, it doesn't ...
0
votes
1answer
22 views

How to chart data stored in a database table (dynamically) in Drupal 8?

I found these instructions for using the Charts module to display data from a database for Drupal 7: https://www.drupal.org/docs/8/modules/charts/charts-howtos/chart-some-data-stored-in-a-database-...
0
votes
1answer
24 views

Display related media entities

We are using the Basic Page content type and it has an Entity Reference field (field_document) that points to the Document (Media bundle), which has a field_document_tag (taxonomy term field). The ...
0
votes
2answers
81 views

Adding a view to node edit form

How to attach programmatically a view to the edit node form in Drupal 8? In D7 I could achieve this by using this code /** * Implements of hook_form_alter(). */ function MYMODULE_form_alter(&$...
2
votes
4answers
2k views

Inserting a view in node edit form

In a node edit form i want to display an editable view, so an author can not only edit the node itself but also can alter some values of other nodes represented by the view, which is editable via the ...
0
votes
2answers
1k views

Views accordion is not working on front page

I've installed Views accordion and worked fine in preview but not in the correspondent page. Any idea how to fix it? I get this error from firebug: TypeError: $(...).accordion is not a function
1
vote
0answers
15 views

Views Table with Aggregation, total values counted per option

I'm setting up a view of event registrations. Each registration will be allocated to 1 of 3 workshops at two different times in the day. I'm looking to output the total number of allocations per ...
2
votes
2answers
839 views

add css if url contains

I have one node type and two page types for this node. http://site.com/themes/* and http://site.com/years/* And i want to hide one of the "view-filed" in all "years" pages using the css. Found ...
1
vote
2answers
2k views

How to do “has term (with depth)” filter on field of a related field

i have a content type 'product', and two taxonomy lists 'company' and 'country'. Country list has one level of depth like: ........ state1 -city1 -city2 ........ Each product has a 'company' ...
0
votes
1answer
14 views

Show terms in view filtered from another view

I have two views, first one is block, second one is page. I have vocabulary, let's call it "food". In the food vocabulary we have that hierarchy: Fruit Apple Banana Meat Chicken Pork Both views ...
0
votes
1answer
48 views

How to rewrite the field of a view with Twig

I created a view with the machine name cgv_product. This view contains the fields "Product Name" and "Custom Text". In the "Custom Text" field, the {{ name }} Twig code is available to display the ...
0
votes
0answers
30 views

Programmatically Importing Nodes from one page to another another

I want to import node that are on one page to another programmatically. Have tried to do by two method $my_view_name = 'view name'; $my_display_name = 'display name'; $my_view = views_get_view($...
3
votes
3answers
1k views

Views UI doesn't provide links to expand fieldsets anymore

I have moved an entire drupal site to another server. While everything else seems to work fine, I can't quite access collapsed fieldsets in Views UI anymore. It looks like this All fieldsets (STYLE ...
0
votes
1answer
98 views

Changing a Profile type Machine Name broke the Admin/People search

I'm working on a Drupal 7 website in which there are several Profile types. As part of a task, I had to change the "Label Name" and the "Machine Name" of one of them: specifically Professional ...
-1
votes
0answers
12 views

Serialization error on views csv export [on hold]

I am trying to use the VIews data export and CSV serialization modules. When I press the export button the page becomes blank and the following error appears in logs: Symfony\Component\Serializer\...
1
vote
2answers
1k views

How to trigger an Action on an Entity from a button in a Views row (without VBO)?

I know actions can be done with Views Bulk Operations (VBO), but I just want a button in each row of a view of entities. When I press the button, the action is executed for that entity.
0
votes
1answer
1k views

Alter a query using <module>_views_query_alter to filter a view by month

I successfully created a view gathering, let's say, events, sorted by date. I also created exposed filters so one could filter the view. I'm attempting to create another exposed filter that would ...
0
votes
1answer
767 views

Error: Syntax error, unrecognized expression: <div id=“ctools-modal”>

I want to display a form in CTool modal dialog, but failing badly. When I click link to show modal form, ajax request is started: POST http://drupal.dev/my_mod/arg1/ajax/arg3 and returns: Error: ...
0
votes
2answers
701 views

Views block link defaults to target=“_blank” using rewrite output

My client is using d6 and views 3. They want to be able to display a box containing a random static image with an internal link to display in the same browser tab or an external link that would ...
1
vote
1answer
399 views

How to use the same EntityListBuilder for entity A and an extended version B

I have used the content entity example coming from the example project. This example define a Contact entity. Next I have extended this Contact class in an Artist class with some added fields (let ...
1
vote
1answer
699 views

How to alter sort handler to keep existing order intact in views

I created a views page using foo plugin.When a user visit the page the city and Clinic/Hospital columns by default are being rendered alphabetically (ASC) as in below screenshot. EDIT: Let's say for ...
5
votes
0answers
27 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 ...
0
votes
1answer
44 views

I can see the changes I made (as an administrator) but as an anonymous user, I can't

Have you had any problems like this before? I appreciate your help. When I'm an admin and update a node (custom module), I can see the changes I made (as an administrator). However, when I'm an ...
0
votes
2answers
851 views

How to display Taxonomy child terms using views?

I have tried using Taxonomy View Depth, I created a taxonomy vocabulary like this Example: Animal -Cats --Brown --white -Dogs --Brown --White What I did was enable the default taxonomy view, and ...
0
votes
1answer
342 views

Get file extensions in drupal exposed filter

I had a content type with a file upload field. The user is restricted to upload files with specified extension in Allowed file extensions settings. I created a view for listing all files. Now i need ...
3
votes
2answers
850 views

Categorizing and Sorting Webform Submissions

I'm trying to find an effective way to categorize and sort webform submissions. I already have them displaying in views, but would like to take it a bit further. Here's the goal: Anonymous users can ...
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 ...
0
votes
2answers
686 views

Contextual Filter not getting the correct NID from URL

I THINK my Contextual Filter from my view is not getting the correct NID from my URL. I have a view page with a path of "node/%/agenda". The link on my menu is "node/[node:nid]/agenda". The view ...
0
votes
2answers
3k views

How to display a list of products in same taxonomy as current product?

I want to display a list of other products from the currently-viewed product's taxonomy/taxonomies on the product page. It would ideally be a text-only list, and would be limited to five or ten ...
3
votes
1answer
682 views

view access permission

I have a problem with view permission, when I make a view in drupal 7 there is an option "access" when I specify the option eg:"view published content" all users that has the role of published content ...
0
votes
3answers
935 views

Checkbox in views

How to bring the input type as check box for a field . I ve used Global:Custom Text and in that field I gave like this in text <div class="cmp-button"><input type="checkbox" name="product-...
0
votes
1answer
351 views

Dynamic content with a view and a block

I'm new to Drupal (using Drupal 8) and have been struggling to get content from a block I've create to display when accessing the view. I've created a "service" view (page) which lives at the path "/...
0
votes
0answers
12 views

Slideshow: Cgi Generic Command execution (time-based)

One of our customers received a notice from his PCI scan vendor that the requests in the MD_Slider module used by Views are not sanitized. The latest version is two years old and it could be correct. ...
1
vote
1answer
1k views

Grouping field in tabs - views

Under views when i select unformated settings and can Grouping field, it is working fine. Now i am using bootsrap tabs but it is not working How we can do this
0
votes
0answers
64 views

Use Drupal's Default Views Filter Handler on “Pseudo” Views field?

How do I use Drupal's core Views filter handler plugins on a custom views field? I have a custom field which has its own FieldPluginBase Class. Does not have a DB query. MYMODULE.views.inc: /** * ...