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
26 views

Make a news item “sticky at the top of lists”

I want to sort my news items by sticky to the top and then date so I can highlight certain news items. The same question was asked here, the answer was to: "Just sort by sticky and after that sort ...
0
votes
1answer
21 views

Show the title of the node from an entity reference

i have a content type, which has in it a field which is of type Entity Reference. I now have created a view, where i need to aggregate on the sum of records based on this field. But my problem is that ...
0
votes
0answers
19 views

View footer summary

I would like to add a footer to a view with a summary with some row calculations. I have tried creating a plugin (AreaPluginBase) but It doesn't give me the rows nor the arguments of de view. I've ...
0
votes
1answer
27 views

Returning from ajax callback ruins view

Currently I am hooking into the add to cart form on my website. I added ajax to the edit quantity buttons like : $form_quantity[$key]['#ajax'] = [ 'callback' => 'update_cart_order', ...
0
votes
1answer
31 views

How to use custom tokens in view header Drupal 8

I make custom token which i use in view filter but now i want to use in view header.The custom token doesn't show in view header Global: Unfiltered text (Global: Unfiltered text) or how i make "...
0
votes
0answers
38 views

How do I control which tabs a block is displayed in?

Drupal 8.8.1 with commerce 2 installed. Goal is to make better use of the ‘logged-in user’ landing page(My Account) by adding blocks of useful content. Blocks created using the UI as well as coded ...
0
votes
0answers
16 views

managed_file FormElement submitting form upon file upload

How do i prevent managed_file(Browse Button) from calling submitForm function upon uploading file? I've added '#attributes' => [ 'submit' => FALSE, 'onclick' => 'return false' ] to no ...
0
votes
0answers
18 views

How do I create a View to use Bootstrap Paragraph fields and group by the title?

I have a View for FAQ's, and an exposed combined fields filter. I created an FAQ content type, and added a paragraph field that contains "Question" and "Answer" fields. I cant use Search API, and want ...
0
votes
0answers
19 views

Rewrite field ampersand converts to &

I have an URL field that I'm outputting in my Services Views endpoint and everything works perfectly until I add a query string. The aim is to add UTM parameters to my URL through the rewrite field. ...
1
vote
1answer
19 views

Custom exposed filter for year in date field with ajax

I am trying to create a custom exposed filter which would be a select field with years (2015-2025). This would filter the result with the year of the date they are created. I followed this tutorial ...
0
votes
2answers
66 views

Get the raw URL of an image in views-view-table.html.twig

In the views-view-table.html.twig template, I can get the raw values of fields by repeating on rows and accessing the view object. For example: {{ view.field.title.value(view.result[i]) }} {# ...
1
vote
0answers
19 views

Exposed grouped filter triggers 'illegal choice' on page load

For Drupal 8.8.2, I've got an exposed filter of grouped items. Ever since the last update to 8.8.2, I've been getting an "illegal choice" error when a user navigates to the page with this filter. Once ...
-5
votes
1answer
40 views

How to link to a file in twig template

I'm trying to link to a file in a view. I have a field in the view that outputs the link if I use it like this: <div class="product-cta-view-pdf"> {{ fields.field_notice.content }} </div&...
1
vote
1answer
25 views

How to programatically change image style of images gathered by view?

I have a view that collect fields of some content type and one of those fields is image field. I can set image style for that image from view editing page and that image in every row will have that ...
0
votes
0answers
28 views

Disable/Hide buttons in view table based on role

Is there any way to disable/hide certains buttons/links in a view table based on role? I want to display admin buttons/links in drupal commerce for all the orders if the user/role is admin, customer ...
0
votes
0answers
10 views

Change ID of search field created with Views

Using views I made a search page and by using the exposed search filter as block I created my search ability on my website. But I need to change the id of my search field. I know I can change to ...
0
votes
0answers
23 views

Conditional re-write result depending on type

Drupal 8 I have a view that outputs search api results from several sources. One of these are some media types. I wish to conditionally rewrite the result depending on the media type. ...
0
votes
0answers
17 views

How to validate a Ajax enabled views exposed form in Drupal 8

How to validate a Ajax enabled views exposed form in Drupal 8. Tried with normal form validation but it only working on page reload not on submit
0
votes
0answers
21 views

Use dropdown in views exposed filter on paragraph text field in paragraph view?

I have it working for nodes but i tried for paragraph view and it is not working Here is the code: function hook_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { ...
2
votes
0answers
37 views

Use dropdown in views exposed filter on paragraph text field in node view?

I have seen Use dropdown in views exposed filter on text fields with node->title? but I need to use there a field from a paragraph field of the node. Let's say the paragraph field in the node is ...
0
votes
0answers
29 views

Custom link in views block

In Drupal 7, I used the Views Panes More Link module to customize the text of the "More" link. I need to do the same thing in Drupal 8. I am using panels but I am open to other soulutions. I have ...
0
votes
1answer
28 views

Custom column in commerce view?

I have a view that lists all the orders. I want an action/operations column in the view which has buttons/links for eg: edit, repeat, delete, upload, download, reset, print. I cannot find a way to ...
1
vote
2answers
51 views

How can you filter an integer column by “Starts with”?

I have a view, and I want the users to be able to filter on an Integer field. String fields allow for filtering by 'Starts with'. I would like to do the same but with an integer. If the user enters ...
2
votes
1answer
26 views

How to add highlighting to exposed views_autocomplete_filter in Drupal 8

Is there a way (a hook perhaps) that would allow me to modify the autocomplete fields returned by an exposed views_autocomplete_filter field? I'd like to style the text typed into the field ...
0
votes
1answer
19 views

Are there any quality of life add ons for Content Admin page? Easier sorting, searching, etc [closed]

I think the words make it vague for a google search since I'm not really finding anything. Looking for enhancements to the Content screen in Admin (that lists all of your content items). You can ...
0
votes
0answers
22 views

How to reuse value from a custom Views field handler in a second Views field?

I have a custom Views field handler: function MY_MODULE _views_views_data() { $data['Customer']['Cust_Number'] = array( 'field' => array( 'title' => t('Customer Number'), '...
0
votes
1answer
18 views

Can I create an aggregate view that only shows totals without details?

I have a view that totals columns but displays each row as well as the totals. Is there a way to hide the detail rows?
0
votes
1answer
34 views

How do I use an entity reference field as a sidebar navigation on a view?

I have 2 content types: category and project. On project, I have a reference field to category. I would like to list all my nodes from project in a view and then use all the category nodes as links ...
0
votes
0answers
10 views

Apache solr and drupal commerce price filter not working

I Create one search api related view in that i added Price based filter using exposed and between operator but that product not filter between values it's taking randomly for example : my quantity ...
0
votes
0answers
10 views

Show all content referenced by another content, regardless of language

I have a "Movie" content type. It can be translated in 3 languages (fr/de/it). I also have an "Event" content type. It cannot be translated. It has a field that can reference a Movie (reference field)....
0
votes
0answers
15 views

Display the terms of 2 different entity references assigned/contextual to a node (display distinct and grouped)

I cannot manage it to list terms of two different entity references contextual to a Node in a distinct manner in one View (with two different views its no problem at all). I have an entity reference "...
0
votes
1answer
24 views

How do I create a view with some customization? [closed]

I like to create a view to display properties information as shown below. View View page 7676 - SQFT 7 - BR I created a view and added the fields based on my design. I made progress, but I am ...
1
vote
1answer
60 views

Views field cache tags does not invalidate the views cache

I've implemented CacheableDependencyInterface on my ViewsField plugin. /** * {@inheritdoc} */ public function getCacheTags() { return ['arbitrary_tag']; } I can see the tag on the ...
1
vote
1answer
49 views

How can I get row field in hook_preprocess_views_view_unformatted(&$variables)?

Is there a way to get a field from the view in the hook_preprocess_views_view_unformatted(&$variables)? $rows = $variables['rows']; foreach ($rows as $id => $row) { // $row['field_name'] or ...
0
votes
2answers
62 views

Breadcrumbs/menu for dynamic pages

Im breaking my head around getting the breadcrumbs set properly on views page. my views' page address is "teachers/%" where % is a term-id. I have a content type called 'program' with a field ...
0
votes
1answer
24 views

How to hide VBO multipage selector in a view

I want to hide / disable the VBO multipage selector above the table in my view but I don't find where to do it. Anyone has an idea? EDIT: I am using the "VBO Export" module and my view is related to ...
0
votes
1answer
22 views

Filter by shared reference

[![enter image description here][1]][1]I have a content type of "School." I have a content type of "Event" that contains an entity reference to "School" so that events can be linked to schools. I can ...
0
votes
0answers
12 views

How to sort nodes in a view with current language first

How would I sort nodes in a view to show nodes translated to the current language first? This would then show nodes that haven't been translated to the current language after nodes that have been ...
0
votes
1answer
33 views

Limit entity reference options base on taxonomy tag

I have three content types. Building, Department and Person. I connect this contents whit entity reference base on Content types. The problem is that I have a lot of persons and a lot of departments ...
0
votes
0answers
41 views

How to filter a view from within a paragraph ideally using url?

I have a basic page that contains a paragraph which has the following field: Label = News View Field Type = Views Reference (reference method = default) This references a view that has a contextual ...
0
votes
0answers
15 views

How to join a custom table in Views based on a node's field value?

Let’s say I have a Drupal content type of Widget that has an integer field “widget_id”. I have a custom MySQL table called “new_widgets” with the fields “id” and “widget_name”. I’m trying to create a ...
0
votes
0answers
35 views

How to show dropdown list of child terms related to parent term?

I know, it is possible to complete this issue by using views. But in this case i can only display an unformatted list of "child terms", not SELECT MENU. I need to show DROPDOWN list of relevant child ...
0
votes
0answers
16 views

Is it possible to put the page value as the link text in a Drupal 8 view pager?

I'm trying to set up my view pagers to look like this "1 < current_page > last_page" where current_page and last_page are numbers. The current page is always working but I can't figure out how to ...
0
votes
1answer
47 views

How do I override a view template in my theme folder properly?

I do not know if I am something missing, but I have a View in Drupal 8 and wanted to make a Template override in my theme, where I would print-out the image URL of one field and set it as "background-...
-2
votes
2answers
33 views

how to filter by date in view - drupal 8

Hello everyone i am working with views ind Drupal8 ,i have a 5 content types that contains all a field 'date' , so i want to display just the content types with date == 2020 , how can i do it the with ...
0
votes
0answers
44 views

How do I theme view fields, with custom templates or overwriting the output from the UI?

I am having some confusion in theming a view output in Drupal. While theming a view with Fields, you can either create template files for every view like views-view-unformatted--view-name--block-name....
0
votes
0answers
17 views

Using a computed field in a view for a specific content type

I have a computed field (entity reference) that is auto-generating a date in a specific Issue type format (Month/Month Year) for the Article content type. I have a datetime field (date_field) in a ...
0
votes
0answers
23 views

Session cookie is causing a problem in a custom RSS feed in my theme

I use Drupal 8.7.11. I personalized the RSS feed via a function in my theme my_theme_preprocess_views_view_row_rss() in view.inc file. I added this to add content:encoded tag in RSS feed called ...
0
votes
0answers
26 views

Taxonomy term name in page.html.twig [duplicate]

I have a list of taxonomy terms to make some categories on my website. When I click on one of them, the content appears, but I can't display the taxonomy term name. I can't find the right ...
0
votes
0answers
22 views

Is there a way to get tokens from webform fields?

I have a few hundred Drupal sites in which I need to submit webform submissions to multiple outside vendors via an email that contains XML tags. For example: <PREDEFINED_TAG_FROM_VENDOR>[...