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

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

0
votes
1answer
11 views

How to override output (query) for views exposed filter?

I have a views with exposed filter of taxonomy terms (select). It have multiple choice, and nodes output with that terms. But I want to change output of result of views for this filter. How can I do ...
-3
votes
0answers
16 views

Hidden fields content in a VIEW where the user is not referenced?

I'm chicken ,how to Hidden fields content in a VIEW where the user is not referenced? I'm try using Views Distinct not success
0
votes
1answer
9 views

How can I create a custom user profile page without overlapping the registration and login pages?

I'd like to create a custom user profile page, but if I use /user/% path then it will also overlap /user/registration, /user/login and so on... Is there any ways to avoid it?
0
votes
0answers
9 views

How to display all items in a nodes reference field in a block?

I want to create a view in a block that only display the items saved in the reference field in the node of the current page. So lets say we have node 1 and node 2, and node 1 have saved node 3 and 4 ...
0
votes
0answers
3 views

Comment pagination widget for views result

Views looks like a good potential replacement for creating a custom forum using nothing more than tags and a content type with a custom view. However, it seems to lack the ability to display comment ...
0
votes
0answers
16 views

View with two blocks

I have created a view and then created 2 blocks in that view. What I want to do is have different fields rendered in each block or, have the same fields in each block but be able to exclude certain ...
0
votes
0answers
16 views

How can I set a css class to an image in a view display?

In a view display I need to apply some css properties, if the node has a particular field (Boolean). I want to use hook_entity_view_display_alter() to realize it. How can I get the field of the ...
0
votes
0answers
19 views

Average field value in view

I have created a content type Reviews and am trying to figure out how to display an average score in views. This is what I have done so far. Created content type Phone Reviews. Added field SCORE ...
0
votes
0answers
12 views

Loop over entity reference view for email using Business Rules

I have an entity reference built to show user name, email and last access. This works fine and shows data in the view. I am attaching this to a Business Rules module action so that I can loop over ...
-1
votes
0answers
18 views

Simple way to create a custom page [on hold]

Is there any simple way to create a custom page in Drupal 7? I want to display some views and sliders using coding on that page.
-2
votes
0answers
16 views

How to create a payment gateway view? [on hold]

I created a marketplace (a site with several stores). I want to create a view to display to the owner of a store, his own payment gateway. It must be able to modify them, delete them and add new ...
-1
votes
0answers
6 views

Views entity reference filter output (relationship problem?

Any Views pros out there? I'm stuck with the output of my select list using a Views Entity Reference Filter display I created. So... I have a Content Type "Movie" with a Field Collection "Cast". In ...
0
votes
1answer
42 views

How to get a count of number of nodes created per week in views and show the week

I am creating a view to breakdown the number of node published per week using views. I were able to create a view that will show me the breakdown day or month but there is no option for week. How will ...
0
votes
0answers
21 views

Access Select Field Value In Twig View Field Template file [duplicate]

I have a content field that is a select list with values set like... option1|Option 1 option2|Option 2 ..etc. and the name of the field is "job_category". I'm overriding the view-view-fields ...
1
vote
2answers
51 views

Get the node title conditionally in a view rewrite field [on hold]

How can I get the field for the title of the content? In twig I need to do this (for jssor slider) : {% if field_titre_url_externe is not empty %} {{ field_titre_url_externe }} {% else %} {{ ...
0
votes
1answer
23 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(&$...
0
votes
1answer
32 views

How work BigPipe cache around block views?

I have 2 blocks with swiper.js around. This 2 blocks are from the views module. I need to print them in the theme like i want so, i load them into the preprocess_page. $block1 = \Drupal\block\...
0
votes
1answer
19 views

Set height and width of image field being rendered with views PHP

The context: drupal 7, views, views PHP, rendering some fields with PHP because there's no other way. $nodo = node_load($row->nid); $strmn = '<div class="post-block">'; $strmn .= '<div ...
1
vote
2answers
39 views

Dynamic “Read more” text link for each view mode

I created an entity reference field for a content type, to display related contents. My entity reference view display mixed of 4 content types (Image, News, Document, Biography). I created a view ...
0
votes
0answers
18 views

Custom fields not visible in Form mode display

The below issue drives me nuts! Through the display form modes, I created a custom display. I added some fields in the display (started with custom fields, but also tried standard fields) None of the ...
2
votes
2answers
92 views

How to get a parameter value from the current URL in views-view-fields.html.twig?

I need the argument value in the theme templates and using the views-views-fields--view_name--block_1.jhtml.twig. I'm current getting the current URL like that: {% set url = url('current')%} Which ...
2
votes
2answers
19 views

How to not have “-None-” as default in the entity reference display widget

I spend hours to figure this out but no result. I want to auto-populate a field using entity references and views. A field has a user entity reference Using filters, I made a view narrowing down ...
0
votes
0answers
14 views

Why is my view not displaying Solr index results?

I have a multilingual site and I created a Solr server, created an index (for all content types), added fields, generated the search (it displayed that all my nodes were succcessfully indexed 8/8), ...
0
votes
1answer
25 views

How to set views pager item size programmatically?

I want to set views pager size programmatically. I have tried below code to set pager size. $view = \Drupal\views\Views::getView('english_chart'); $view->pager['items_per_page'] = 5; $view->...
1
vote
0answers
22 views

How to filter only first level menu links using views?

I have created the menu with the below structure, A Link A1 List A2 Link A21 List A22 B Link B1 Link B11 List B12 List B2 Now my requirement is to get only first level menu links i.e A and B ...
0
votes
0answers
35 views

View block (NOT page) that takes contextual filter argument from URL path component

My question is exactly the same as View block not accepting contextual filter argument but I'm unable to comment and the question never received a valid answer. I want to know if it is possible to ...
0
votes
0answers
24 views

How to add custom AJAX functionality to views form

I need to add a button to an exposed views form that is available for logged-in users. This button should perform some actions via AJAX when clicked. The form has AJAX enabled. I used the following ...
0
votes
1answer
19 views

List most recents files used

We have a Documents bundle which is a list of documents, and an Accordeon which includes the previous one. NODE_PAGE | |--- DOCUMENTS | |--- ACCORDEON | | | |--- DOCUMENTS With this choice, I ...
-1
votes
0answers
24 views

Rewrite modal confirmation window of flagged node through views list

i'm using Flag in Drupal 8 and would like to print values's field of flagged content into the modal confirmation before to confirm the flag. Is there any way to do this ??? More information Hello, ...
-1
votes
0answers
13 views

How do I fix this error with <script>? [closed]

{ "@context":"http://schema.org", "@type":"WebSite", "name":"Site name", "alternateName":"Site alternatime name", "description":"Site description", "keywords":"list of keyword", "...
0
votes
1answer
25 views

Behavior of taxonomy-term classified paths

We have customer who insists that there is a setting/method that will order the listing-page for taxonomy attributed event-type by date ascending. My exploration has lead me to the .../admin/config/...
0
votes
1answer
23 views

Filter criteria date and granularity

In my view I filtered for date "greater than now" and in the settings I put granularity "day". I can see the 3 events correctly, but they are grouped by "month" and not in chronological order though. ...
0
votes
1answer
34 views

Filter product displays by parent taxonomy term

I'm running a music store and have a taxonomy term field on products that that is used for the product's format. We tag the products from the following vocabulary. Vinyl 140g vinyl 180g vinyl CD ...
0
votes
1answer
20 views

Count words of a body field using PHP views field

I'm looking for a way to count the amount of words in my body fields, using Views PHP. I am totally new to PHP and this looks so easy, but I must be missing something. So I have a View for Content, ...
1
vote
0answers
28 views

How create Menu items by permissions for a view page?

My client wants a menu with a link for each content type. Each item will displayed if the user have permission to create that content type. Each item will show a list of content only for that ...
0
votes
0answers
19 views

Current term as hidden field

I am setting up some custom blocks to show when on a taxonomy page. Is there any way to retrieve the taxonomy name of the term that is being visited and add it as a field? A hidden field to be exact....
0
votes
0answers
36 views

How do I add operations?

I'm using Search API module. I have created Content Search Index. By default it's not providing Operations (Edit/Delete). In module.theme file function HOOK_views_data_alter(array &$data) { $...
0
votes
2answers
23 views

How to place a role-aware “Add new” link at the top of a Views listing of media

I've created a view that provides a listing of a particular media type on my site. I'd like to place an "Add new" link at the top of this view and have it visible only to users who can actually add ...
0
votes
0answers
13 views

Combining contextual filters for direct and indirect relationships

We are trying to create a single view with multiple contextual filters. The goal is to display the content of type Alice related to content of type Bob. The reference is set on type Alice using a ...
-1
votes
0answers
23 views

Search by title only [closed]

I have created a custom view for /search/node. The content field is not exposed, but the search results are still returned based on the content field. Any solution?
0
votes
0answers
29 views

The “Rendered entity - Custom menu link” Views Header option seems useless [closed]

In Drupal8/Views I'm trying to add a custom menu link to a view's header. I'm using the "Rendered entity - Custom menu link" option. The menu ID I'm using is the numeric ID for a link from a menu ...
0
votes
1answer
21 views

Views not respecting Contextual filter and Referenced Entity relationship

This is driving me crazy because it's so simple in Drupal 7. Scenario: Basic page has a entity referenced field where you can type in Spotlights that should be shown at the bottom of the page. ...
1
vote
0answers
26 views

How do I display the correct amount of nodes on a view?

I have a content type called "spotlight". It's just a box that sits at the bottom of each page with related content inside of it. I have the view set up correctly to display 4 items (because that is ...
0
votes
0answers
14 views

How to edit Views results using postExecute in a field handler?

I have a custom field handler which returns JSON data, and I would like to alter the output prior to the render() function in the handler. This is mainly for the purpose of compatibility with another ...
0
votes
1answer
29 views

How do I apply a global filter on view tabs?

In Drupal 7, I have a view where I show different view tabs of different content types. I want to apply a global filter on those view tabs. How can I achieve it?
0
votes
0answers
29 views

Double escaping in a view

Drupal 8 view using view mode is rendering the body with &amp;amp;, when the body contains &amp;. The format of the view mode does not alter the double escaping that appears to be occurring. ...
1
vote
2answers
50 views

How do I check if a user has view access to a node, in a template file?

I'm currently working on a simple LMS in D8 and have already defined the fundamental content types. Among them is a content type called Course, which can be considered "Premium" content, i.e. all ...
0
votes
1answer
54 views

How do we pass php code as a twig variable in global custom text field of views

How can we pass this php code as a twig variable in global custom text in views without using views php module? I have created a view of news content with masonary layout . <?php $language = \...
0
votes
1answer
21 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
0answers
29 views

Dynamic Block to display Chart per User Profile Parameter

Every user has different parameters. Parameters are custom field of unlimited number of values in User Profile (using Profile2 module). For example, User1 has parameters: Personal, Work, Health. Every ...