A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [views]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

How do you reference Font Awesome in the CSS of your drupal site?

I have installed the Awesome Font module, and it uses the external file location: https://use.fontawesome.com/releases/v5.12.0/js/all.js In my css I entered the following: .bs-region--top::after { ...
0
votes
1answer
17 views

Call another field inside preprocess_views_view_field

how can I access the value of another field inside the preprocess_views_view_field. This is an example: function THEMENAME_preprocess_views_view_field(&$variables) { $view = $variables['view']; $...
0
votes
1answer
13 views

Send view field in URL - Drupal

I have a search page created with embedded filters in Drupal 8 View. In the list of fields I have a fields - [Field_program_id]. I also have a button 'Learn more' when clicking this button I want to ...
0
votes
0answers
7 views

Search API File search missing filter operators

D8 Webiste Probably missing something obvious here but... I am trying to create a view that can search an index generated by Search API. I want to include files in the search. Ideally with an ...
1
vote
0answers
44 views

Why can't I remove the %20 from a URL evaluated by a contextual filter?

I created a view with contextual filters with taxonomy terms that have two words, so that space creates a %20 on the URL. I found out that the solution is to checked the "Transform spaces to dashes in ...
0
votes
0answers
12 views

Custom views filter plugin: cachetags invalidation does not effect option list

I described a custom views filter plugin extending InOperator. The aim is to offer a select list where the user can choose from a list of fractions of a legislature. Legislature and fractions are ...
2
votes
1answer
41 views

How to get total number of rows on a block of a view

On hook_block_view_alter() I need to get a total number of rows that this block displays. For example, I have a view with the following block: On hook_block_view_alter() I do the appropriate checks ...
0
votes
0answers
8 views

Views Grouped filters using Relationships and Allow Multiple Selection

I have a View with Grouped filters using a Relationship and allow multiple selection options, however, it does not render multiple selections results
0
votes
0answers
13 views

Views contextual filter allow multiple values not available

I'm building a view to see some webform results. I'm trying to add a contextual filter to limit results to certain values entered in a field, but the option to allow multiple values is not allowed. ...
0
votes
1answer
22 views

Can we access paragraph field in views-view-unformatted.twig?

Is there a way to access the fields in paragraph in views-view-unformatted.twig. I want to perform checking on field of paragraph before print the row something like this {% for row in rows %} {% ...
0
votes
0answers
30 views

Configuration Import Error

I have a drupal8 in local system. I want to import my production environment configurations into my local. So i am running drush cim -y I got the following error. Unexpected error during import ...
0
votes
0answers
8 views

Need help with View Merge Rows, rows not merging

I'm using Order Reports and each of the report items (promotions, sales tax, order items) are in the order reports as separate line items. I need to combine all the line items with the same order ...
0
votes
0answers
13 views

View filter criterion: D7 -> D8 equivalents

I am creating new views in Drupal 8 to replicate ones from a previous D7 installation. Under D7 "File: Type" our operator choice was "is one of." Which of the following is the closest D8 equivalent? ...
0
votes
0answers
11 views

How can I update view's exposed filters on user selection

I have a view which has to taxonomy filters exposed, lets say "Tax 1" and "Tax 2". The filters are set as selections. Now lets say that the user selects one of the items of Tax 1. Now the content ...
1
vote
1answer
19 views

How to access link fields (url and text) value separately in views template?

My views block has a Link field named field_link, attached to a Content Type named products, and I'm trying access link field values(url and text) separately in views template views-view-unformatted....
0
votes
1answer
15 views

Fully display only most recent post on front page, furl the others

Currently my Front page will only show a teaser for all my new posts. I know that I can go to Structure > Views > Frontpage and change it to show Content | Full which will show the full post of ...
0
votes
0answers
13 views

How to trim a Full HTML format field value, which can be used inside hook_preprocess_views_view_field(&$vars)

I have created a Taxonomy View that has a Global : Custom Text field, using hook_preprocess_views_view_field I'm placing other field's values with some customized markup in that field. Now what I ...
2
votes
1answer
26 views

How can I use a replacement pattern in a custom field?

I just created a new custom field in a view, but I would like to use replacement patterns in that field. Is it possible to do this? class CustomButtonField extends FieldPluginBase { /** * {@...
-1
votes
0answers
24 views

View not returning all items (error in relationship)

I am having issue with my view. its not returning all results. When I debugged the query I found that the relationship is linked using target_revision_id not target_id. Here is the query: SELECT * ...
0
votes
1answer
21 views

Sort by taxonomy weight

I have a content type 'Member' with a field referring to taxonomy term called 'Member role' which is a multi value field. Each member may have up to 3 member roles. I have created a view to display ...
0
votes
1answer
51 views

Use hook_views_pre_render() to change field to url link

I want to use hook_views_pre_render() to read in a view and change a field output to a clickable link. Here is code: function sbn_views_pre_render(ViewExecutable $view) { // https://drupal....
0
votes
0answers
31 views

How can I print just one field of a view in a block template? [duplicate]

I created a view block that is "more by this author" and was able to configure the view so that it pulls the author of the current node and shows more pieces of content by that author. Hurray! I ...
0
votes
1answer
13 views

How do use hook_views_pre_render() to modify view fields

Want to use hook_views_pre_render() to modify a field in view based upon data in another field. Starting with this code: function sbn_views_pre_render(ViewExecutable $view) { drupal_set_message($...
0
votes
0answers
6 views

Adding a new field to the layout_builder_update_block/layout_builder_add_block for a view block for usage later

We are using layout builder for adding view blocks to node pages. I need to modify the "add/update" form with a new boolean field (checkbox), and use the results that are stored (true/false) later on ...
-2
votes
1answer
38 views

How to programmatically add a “more” link?

In the Views UI (in the center column), we can select "More link" which provides a checkbox to "Create more link." Selecting this returns a link for more results of the view. How would I ...
-2
votes
1answer
24 views

How to place multi view in one page?

I have two content types and I wanna place two content views in one page with different display modes. How to solve it?
0
votes
0answers
20 views

Views rewrite results break URL

I am using Drupal 7 version 7.68. I have a view that gets an external URL from a field, rewrite's the results and then is outputted as the URL. I expect to see a link saying 'See More Details' that,...
0
votes
0answers
13 views

Change default selected exposed filter based on langcode

I have a site with three translations FR, DE, and IT using the Entity Translation module. I have a View with an exposed filter of 'Language' with options of French, German and Italian and am trying to ...
2
votes
0answers
35 views

How to change date format in an ajax View's exposed Date filter that uses BEF?

I have a view with Ajax option enabled and using some date filters with better exposed filters (latest version). What i'm trying to do is to change the default date format of a date filter from mm/dd/...
0
votes
0answers
20 views

Calculate total numeric field entries

I have a content type titled 'Books' with a Number field titled "Ratings" and Entity Reference titled "Author Name". I have created several nodes with the Book titles, Author Name and the ...
0
votes
0answers
30 views

How to revert views

I had a working view. I have tried to modify it by removing the the relationships then it crashes. Now I am not able to edit the view. How to revert back the previous changes of view. Here is the ...
0
votes
2answers
30 views

How to use views filter criteria in a custom exposed view filter?

I am using Drupal 8.7.11 and have created a custom views exposed filter which provides users the option to filter an entity reference field using a checkbox list of names instead of autocomplete. At ...
0
votes
0answers
28 views

select distinct articles in views not working

I am trying to remove the duplicate selected article. Even though my filters are simple and direct I am still getting duplicate articles Here's screenshot of my view Attempts I used: 1. I have ...
0
votes
0answers
23 views

Exposed Taxonomy filter relationship with two levels

I have searched about that but I didn't found any solution for my problem, I also tried to combine different solutions that I found but didn't work. Those solutions were different combinations of ...
0
votes
1answer
11 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
12 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
31 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
15 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
46 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
38 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
51 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
32 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
32 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
38 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
52 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
42 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
55 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 ...