Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
19 views

How to open a link in ctools modal by clicking a views row in table format?

I want to open a page in ctools modal. This works for me. <a href="/my-page/nojs" class="ctools-use-modal">Click</a> But now I want to open the same page in ctools modal by clicking the ...
1
vote
0answers
18 views

Only show view/block on nodes with certain field value when using “Content: Has taxonomy term ID”

I've set up a view of related content that has a block display and 2 contextual filters: "Content: ID" with "Exclude" "Content: Has taxonomy term ID" with "Load default filter from node page, that's ...
0
votes
1answer
34 views

Modifying twig file to show elements side-by-side

I am working on views with embedded filters and my resultant view fields have the below twig setup: {% set index = 0 %} <div class='row'> <div class="panel panel-default"> <...
0
votes
0answers
51 views

Translate view (multilingual module)

I have create view where it get an image banner from custom post type. Using multilingual module I could translate all nodes. except the view. any way in how to achieve this? I followed this answer ...
0
votes
0answers
18 views

Select multiple terms in filter criteria(non-exposed) in views drupal 8

I have 2 categories 1.primary, 2. other. both have same terms. when I add content type I select a primary category and other category. but article/ content-type is not displayed in other category.my ...
0
votes
2answers
50 views

“admin/people” filters not available anymore

I have Drupal 8.7.3 so at admin side on people listing page I can't see the filter to find a particular user.
0
votes
1answer
54 views

How to show the status of a referenced webform in view of nodes?

My use case is a list of events and I want to show a label on the views item, if the event is already booked out. Therefore I would render the status of the referenced event registration webform. ...
0
votes
2answers
116 views

How to set multiple arguments for views contextual filters from twig

Am using twig tweak module to render views from Twig file. I have pass multiple values for the country contextual filter in the view. I was able to pass single parameter like: {{ drupal_view('...
-1
votes
1answer
33 views

How do I create a view for a single node? [closed]

I have a Company details content type used to create 20 nodes. I created a view for that content type which displays all its nodes. I want to create a view for a single node. Is it possible? How?
0
votes
0answers
20 views

How to render blocks based on a view result?

I have this views page which acts as a search result page for search API with SOLR. And to improve it I added facet and sort blocks. It works alright, except that when the search doesn't return ...
0
votes
0answers
48 views

Variables unavailable in views field template

I'm overriding the default views-view-field.html.twig for a specific field in a view. The template is named: views-view-field--conference_overview--page_1--field_media_oembed_video.html.twig Note: ...
1
vote
1answer
39 views

Node display based on conditional view [NULL] field entry or a Rules expression

I am trying to find a solution to empty user Content Listings shown on a User dashboard (landing page). Ideally I want to show a Mini-panel pane or Custom Content Pane instead of a users listing View ...
1
vote
1answer
56 views

How can I add styles attribute to Global Custom field markup?

I have created a view to display my articles and I would like the article thumbnails to be used as background. So I added the different fields I've hidden. I added a relationship to the image field ...
0
votes
1answer
45 views

How to use text from a block view as a prefix to a node title

What I would like to do In Durpal 7, I am using a block view to display our manufacturers name above our node titles. We added a custom region above content, and that is working fine. However, I ...
3
votes
1answer
62 views

Hide the header of a view block when there is no content

On a page, a views block should show some text on top of the view when the block doesn't hide and there is content to show: <h4>Title <span class="dot white">•</span></h4>. Now,...
0
votes
1answer
12 views

Add title for sections in a view

so I am trying to create a view via Drupal 8 Structure->Views, and I am setting up this view to display certain shops in certain areas, I would like titles above each type of location of shops, so I ...
1
vote
0answers
33 views

Custom view multiple-value field

What do I need to adjust to make this code work? {% if fields.field_video_video[1].content|striptags|trim is not empty %} {{ fields.field_video_video.content }} {% endif %} The logic is to ...
0
votes
1answer
11 views

Media Title appearing in View when HTML is stripped

I've run into an issue with media in a view. I have a view using bootstrap grid to display body field content. The view field content being displayed is setup to strip out HTML, but the word "Image" ...
0
votes
0answers
44 views

Imagestyle not being created

I'm on Core 8.7.7 I have a content type: "events" They have fields: "Date" and "Image" Events get displayed in 2 lists: Past events (a view) (just a block showing event entities) (> this is a ...
2
votes
1answer
26 views

In views, how do I show posts from this calendar day, ten years ago?

I have a view in which I want to display posts that I made on this date 10 years ago. I can get close but not exactly what I want by setting the view's filter to the following: "Authored On is ...
0
votes
1answer
17 views

How to return the whole entity referenced by a entity reference field with views

I have content type A with a entity reference field that references a user (let's name it field_user_reference). The user has field_b and field_c field. I've created a rest export view to return all ...
-1
votes
1answer
43 views

How do I programmatically add a “Load More” button?

I am trying to add the "Load More" button in the block view programmatically. Initially, I am loading the 9 contents but when clicking on the button next 9 contents should load from view. How can I ...
0
votes
1answer
31 views

Views data export user role field value missing from exported csv file

I'm using views_data_export to export data from the views displays. I added a Data Export option to the user account list views. When I use the batch in export settings, user role field is missing in ...
1
vote
1answer
68 views

I can't get the correct current language in node URLs

In D8, I have a website set up with 5 languages, using file path, like so: website.com/en/link website.com/en-us/link website.com/fr-ca/link etcetera. I've made a view of blogs and resources. It ...
2
votes
2answers
40 views

Add wrapper to Views Rest JSON Output

I am rebuilding an API in Drupal. The structure of the JSON must remain the same. I am using Views and Draggable Views so the user can order items on an overview page. I Enabled the view for ...
0
votes
2answers
70 views

What hook to alter the result of a view?

In a custom module, I have a custom entity for which a view shows the following values: Contact is the ID of another entity (Person) containing some fields, such as Email. Adresse courriel is a ...
-2
votes
1answer
34 views

How to show only my content? [closed]

I want to make a view that only show the content that is made by the user itself. For example, I have a library and it contains all content that I flagged, but I also want to show all content that I ...
1
vote
1answer
25 views

Entity relation field view

I have a D8 entity reference field question. I have 3 content types: Student, Class, Book. A student can have several classes and a class can have several books. I have in student an entity ...
0
votes
1answer
101 views

How to get user's current language code in Views?

On Drupal 8.7.10 How can I get the user's current language code into Views as a raw value, such as 'en' or 'fr-ca'? This is not for filtering content. I need the raw value of the users' current ...
0
votes
0answers
20 views

How to add a (not available) relation to a View?

I have 3 custom Content Entities (ContractSubscription, Member and Person) with a bunch of field of which these ones: In ContractSubscription, the id field is defined by default and the field ...
0
votes
1answer
58 views

Ajax callback is not working on views exposed filters

I am implementing dependent filters in views exposed filter for content:datasource search(Solr search). I have a requirement that in exposed dropdown field when a category is selected, by ajax i need ...
0
votes
0answers
20 views

Create View that list all bundles of entity depending a taxonomy

I will try to be as clear as possible. The arborescence looks like that: | Taxonomy_Name | Tax1 | Tax2 | Tax3 | Tax4 | Entity_Name | Bundle1 | Ref to a Taxonomy_Name ...
0
votes
0answers
9 views

How to display 'Sort by' filter dropdown in results section?

I have a search page that has filters on the left bar and results on the right. I want to display the 'Sort by' drop down on top of the 'Results' section. I have a custom template for the results ...
1
vote
2answers
102 views

How can I filter child terms in an exposed filter by parent term from contextual filter?

I have a vocabulary of Districts with nested taxonomy terms like below. I have a view of taxonomy terms in Drupal 8 which has an exposed filter of all terms with parent and child. What I want is that ...
0
votes
1answer
24 views

How to add Download link to File field

I would like to know how I can make File field type display the upload as a download link, instead of having a link. So that user can just click and it will download). The file field type, I added to ...
0
votes
0answers
36 views

How to correct html code for apostrophe appearing in Views contextual filter select list?

I am finding that taxonomy terms containing an apostrophe are not rendered correctly when seen in a Views contextual filter select list. I am working on as school website and Parent's Evening is ...
0
votes
1answer
16 views

How to add class to the options for type radio present under radios?

function template_preprocess_bef_radios(&$variables) { $variables['children'] = Element::children($variables['element']); _bef_preprocess_nested_elements($variables); foreach($variables['...
0
votes
1answer
23 views

How to create a view that shows a Managing User all content of their members?

I want to create a View that lists all content of authors who have the same value (text) as the viewing user. Actually they are members and the viewing user is the manager of the members. I have 2 ...
0
votes
0answers
18 views

Can I Display Date Time as saved in database without DST adjustment in View

My view has data from a Feed that already has the correct time stored. Apparently the view is adjusting for DST before displaying to the user. Thus, my Sales and Service Techs are seeing the ...
0
votes
0answers
17 views

CSS attributes missing from Views Field

I have a field formatter that adds a CSS class attribute to the item by code like this in viewElements $item->_attributes = ['class' => ['my-class']]; It works perfectly when the formatter is ...
0
votes
0answers
21 views

Adding custom module field to views

I am currently fixing a client’s website built on Drupal 7. I created a mini custom module to add one feature. It adds a field to ‘drupal_node’. I was wondering how I could make that field available/...
0
votes
1answer
31 views

Show multiple drupal 7 'name field' in one view row?

Using this on D7: https://www.drupal.org/project/name The name field is on a 'book' content type. 1-to-many authors. In views, I want to see the name of the book, and the authors. Currently, it ...
0
votes
0answers
12 views

Show all values from multivalued flag in one line in Views

I'm very new to drupal (~3 months). I'm creating a PSU site to manage project proposals. One of the pages I'm creating allows the user to view the submitted project proposal, flag/unflag as interest (...
0
votes
0answers
25 views

How to refresh a view after a webform is submitted

I have a webform placed in a block below the webform block I have a view that displays the content now I want to refresh this view after the webform is submitted. The webform is ajax enabled and so is ...
0
votes
1answer
24 views

Fatal error when using some filters or sorting options in admin/content

Using Drupal 8.8.0, multilingual, on localhost (Windows 10, PHP 7.3.12). I have a fatal error on the admin/content page, but only if I use certain options for sorting or filtering the results. ...
0
votes
0answers
29 views

How to render related nodes by vocabulary X on vocabulary Y terms?

I did many research about related nodes by term. These solutions are good with related nodes by term on node pages but does not work on term pages. Solutions I found: Add "Content: Has taxonomy term ...
-1
votes
1answer
137 views

In views use the value of a field in next row, in current row

I would like to use the value of a field in row 2 of a views table output, in row 1 so that I can do some basic math on it. This is what I would like to do: Title | Field_x | Field_y+Field_y(2) | ...
0
votes
0answers
22 views

How can I create a menu item AND tabs in a view?

Building on How to create views tabs in D8? where the asker gets information on how to turn the different pages in their view into tabs, I would like to also add a menu item for my default tab in the ...
0
votes
1answer
21 views

Display view on all page routes

I would like to display a multi value media field and its file type and size in a content type and display it in a table layout. I thought using a view would be the best way to pull the media file ...
0
votes
1answer
25 views

Display the URL of where the content is located in my search results

I'm using SOLR search/search API on my Drupal 8 site and I've set the view to display the following two fields: Content datasource: Title (The title & link to the page) Search: Excerpt (...