Questions tagged [views]

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

Filter by
Sorted by
Tagged with
-2
votes
0answers
28 views

Prepoulate content in comment

Scenario: I have purchase request content type.It has a paragraph referenced field.(requested items). User creates a purchase request and another user will be able to add a price for items in comment ...
0
votes
0answers
32 views

Custom views filter (select) handler error

I need your help. I try to make a custom views filter with a entity reference. I have some problem. I have this message, when I declared : The handler of this element is defective or missing. The ...
1
vote
1answer
73 views

How can I ensure that fields from a Views query plugin work as tokens?

I have a Drupal 7 Views query plugin module that pulls in data from a RESTful API for use in Views. I used this series of articles as a starting point to build it: https://www.lullabot.com/articles/...
0
votes
1answer
11 views

How to add library if Ajax is enabled for view?

We have a view, myview, where Ajax is disabled. We created a custom library that would override the load more button's indicator so that we can use our own. However, we would only like to add this ...
0
votes
1answer
13 views

Stop displaying content of subpaths for invalid URLs

I have views set up, with following paths: www.example.com/news www.example.com/projects If a user goes to www.example.com/projects/not-a-url or www.example.com/news/not/a/real/url it displays the ...
1
vote
1answer
11 views

Remove node_access check from content revisions view

For the 'content' Views one can simply check tickbox 'Disable access checks' in UI under Advanced => Query, and the View returns all the records regardless of the node_access check. However, in the '...
0
votes
0answers
12 views

How to select specific entities from a view made as an REST export

I have made a REST export from a view, which is fine when I set it up to SHOW "FIELDS", which I select and define myself. My issue is if I set it up to show: "ENTITY", then I get a HUGE result set ...
0
votes
1answer
30 views

How to change the field label in an API response

How to change field_canonicalurl to canonicalUrl and field_teaser to Teaser? Below is my API output from my View: [{"field_canonicalurl":"","title":"This is the title ","field_teaser":"\u003Cp\...
0
votes
1answer
19 views

View that filters content based on current page

I'm in the middle of a Drupal 6 to 8 migration and am attempting to recreate a view. This view would appear on pages of the content type "People" and would show the "Publications" that this person is ...
0
votes
0answers
18 views

How can I use a conditional statement to display field collection items? [duplicate]

I have a field collection with 3 fields. The max limit of the filed array is 3. What I want is checking filed value and display them according to the following conditions. if the fiel[0] has value ...
-1
votes
1answer
15 views

Passing values in view block to contextual filter on Panelized Node

I have a view set up with a contextual filter for year (select list field). I want to have the ability to have one view and pass the year to the view. Now I have panelized nodes that I add the views ...
0
votes
1answer
11 views

Views exposed filter with selected tags/terms

I am importing RSS content with Feeds Module that is tagged with the Atom standard category-tag. I would like to give the user the opportunity to filter the content in a view, but only by some ...
0
votes
1answer
33 views

Have can I have a view grouped by nested hierarchy?

I have a nested taxonomy as follows: Some forms will only have the taxonomy of "Basic Forms", some will have taxonomy of "overtime forms", etc. So I want my Forms view to look like this example: How ...
0
votes
0answers
44 views

Hook “form_views_exposed_form_alter” is called multiply times

I would like to understand why form_views_exposed_form_alter is called multiply times. There is just one view, also there is just one exposed filter. However the hook is getting called twice. ...
0
votes
1answer
25 views

REST Export Serializer adds quotation marks to my field

I'm using the REST export to expose a list of my nodes including some fields. One of the fields is paragraphs field with subfields. I have written a formatter for this paragraphs field that puts ...
0
votes
1answer
32 views

Is it possible to show a menu in a view as buttons? [closed]

I'm trying to build a page with a quick menu. Now I've created a menu by the regular way and I've shown this on the place i wanted. Now due to the way my site currently looks, this is very out of the ...
1
vote
1answer
71 views

How to get entity Translation's title in Twig

i am trying to get row title -node title- in my custom module with template_preprocess_modulename_view($variables) and views-modulename-view.html.twig with using row.content['#row']._entity.title....
0
votes
0answers
12 views

How to print in views field template the url of a multi field image?

I would like to print in a views field template the url of each image of a multi field image. This is my code but print only the URI $vals = $view->field['field_property_slideshow']->get_value(...
0
votes
0answers
15 views

Implementing a contextual filter in a view with nested taxonomies?

We have a menu with submenus, for example: MenuItem1 Sub1A Sub1B Sub1C MenuItem2 Sub2A Sub3B Sub2C MenuItem3 Sub3A Sub3B When you click on MenuItem1, we want the view to display the ...
0
votes
1answer
62 views

Get title of referenced item two levels deep with Search API

I have three content types: A, B and C. A refers to B and B refers to C Now with use of the search api module I search my content types and I want to only output C. But in the result I want to show ...
0
votes
0answers
73 views

How to display fields in random order in a view

Hi I have a view that display mcqs (multiple choice questions). I want them in random order. I successfully sort the questions (one question in each node. I create a custom content type) randomly ...
0
votes
0answers
63 views

Contextual filter to get node by URL alias [on hold]

I am working with Drupal 8 Views REST APIs. I want to get a single node by alias URL using the contextural filter. by default drupal look for NID. By default, it's like this www.website.com/node/4 ...
0
votes
1answer
9 views

What is required for a view menu item to show up as a link in the admin page?

I'm creating several views that are to be used as reports. Since they all have a common topic, I'm grouping the views under a sub-path of admin/reports (e.g. admin/reports/data/needs_correction and ...
0
votes
0answers
42 views

View with a relation 1 to N in the inverse side

I'm working on a Drupal 8.7.3 application and now I'm trying to build a view page for a content that is related in a relationship 1 to N, but it's on the inverse side. Let me clarify: I have products ...
0
votes
0answers
22 views

Listing two different custom entity types in one view

We defined two entity types, questions and answers. They are related to each other but we will need a view listing all questions and answers in order of title or created date for example. When you ...
0
votes
0answers
19 views

How to show contextual filter results for arg1/arg2 OR arg2/arg1

I have a very simple view that displays the author UID as well as the (entity)recipient UID. How do I show results for arg1/arg2 AND arg2/arg1 First Argument: Author UID Second Argument: Entity UID ...
0
votes
1answer
29 views

Auto-submit exposed form

I'm currently working on a views exposed form block. I want the form to auto-submit using AJAX, whenever an exposed filter is changed. I have searched for this, but I couldn't find any tutorial or ...
0
votes
0answers
37 views

View page count in Twig template

I can't seem to figure out how to get all this information in one line in a views template. <div class="pagination--totals"> Page @current_page of @page_count <small>(@total Results ...
0
votes
0answers
20 views

Admin file upload assigned to specific users

I'm looking for a way to allow the administrator to upload files. These files will be for specific site users (think receipts, test scores, etc) and can only be viewed by that specific user. Things i'...
0
votes
0answers
23 views

Rules action “Send Mail”: doesn't work for more than one recipient

I have installed Rules, Views Rules, Phpmailer. Test mail works. In a rule, I have three actions: 1) Send mail to a specific address: it works! 2) Send mail to all users of a role: it doesn't work ...
1
vote
2answers
35 views

How to make an nid replacement in a Text area inside Footer?

I want to generate an nid of the current page in the Text area inside the footer of a view. I cannot add the ID (node id) in the Footer. What is the proper way for doing this? Any hint? Thank you.
0
votes
1answer
40 views

Adding a view block to a basic page

I have been tasked with creating a new basic page that contains displays, the content of some new content type. So far, I have created the basic page and I have also created a new view block (i.e. I ...
1
vote
1answer
24 views

How to align views pager url with real page number?

When creating pager in views (D7) you get urls with query parameter like page=X by default. But this X does not match actual page number. page=1 is generated for 2 link in the paginator and so on. ...
0
votes
1answer
21 views

Showing fields from different bundles that are related

I'm trying to display the fields of one content type while searching on another content type. More specifically... here is my situation: I have a view based on an index with fields in Organism and ...
0
votes
0answers
20 views

Import/export content to CSV along with the field collectors

I have added the "field collector" fields in the content type to create relation ship between 2 content types and they are looking good but i want to load the data for the content type from the CSV ...
0
votes
1answer
12 views

Views Add Link to product field missing

I have a search results View which list the (Commerce) products. I show the title and the image fields. I those fields to wrap in a custom <a> link tag. When I am adding fields, I miss the 'Link ...
1
vote
1answer
46 views

Add CSS class to view image_field in twig

In my custom view fields twig file views-view-fields--search--product_result.html.twig I try to theme my view item. {{ fields.field_images.content }} <h5 class="card-title">{{ fields.title....
0
votes
0answers
11 views

How do I retrieve tagged nodes as well as untagged?

I have a View, "Product Reviews", that retrieves all Product Review nodes (custom content type) that are tagged to the Product you're currently viewing. So, if you're on the page for Product XYZ, this ...
0
votes
0answers
23 views

Replace the first tab in the user profile

In the user profile, I try to replace the first "View" tab with a new tab with views. So I add in "Page settings", for Path: / user /% user, and Menu > Title link menu: My tab > Parent: user ...
0
votes
1answer
9 views

View with relationship - column displaying count of related nodes

I have a content type ("Interviewee") and a Media entity using the new media stuff in core (e.g. Remote Video) which have entity references back to the Interviewee entity. I then have a view of the ...
-2
votes
1answer
15 views

Adding Custom Link as View Fields

I want to add a custom link to the View field set for linking to the "Details" part. The link should be /event/{{ nid }} and the result should look like the following. I found two modules called ...
1
vote
1answer
48 views

How do I get the base URL from the feed content?

Basically, I'm using the Aggregator module to import content from an RSS feed. The content is just a bunch of articles. I display this content in a view. This is my current output, it shows the title ...
0
votes
0answers
44 views

How do I update programmatically some display_options of my view?

In a custom module (sel), I have a View displaying a custom content entity (Exchange): Here is the corresponding configuration file (views.view.sel_echanges.yml): id: sel_echanges label: SÉL-...
0
votes
1answer
26 views

How should the view data be defined when adding a custom filter to a field?

How to add a custom views filter handler for a specific field? answers on how to add a filter to a base field. I'm looking to add a filter to a non base field. (The field name is contact). Here's ...
0
votes
0answers
21 views

Use Ajax in pager in custom module

how can i use ajax in pager $pager = [ '#type' => 'pager', ]; return [ '#theme' => 'news_filter', '#articles' => $articles, '#categories' => $categories, '#count_res' =&...
0
votes
1answer
26 views

Configure a view to display nodes that match a term value of the container node

I have two content types: Programs Events I have a vocabulary: Programs I have a view that displays Events, and I place the view in my Programs nodes. Both Programs and Events have a ...
1
vote
0answers
37 views

How do I override the date filter to filter by years instead of exact date?

I want to add another option to Date filter to filter with only years not the exacte date. So i want to add another radio option here: Like: The above options added by Date Filter. I have tried two ...
1
vote
0answers
23 views

Views sort handler on dynamic field

Background I've built a custom entity using the drupal console, which was kind enough to implement an instance of EntityViewsData for my entity, called MyEntityViewsData. In the call to ...
0
votes
1answer
40 views

How to Make Managed File Field Available to Twig Template?

I am wanting to make it so that users can upload images to a block configuration form for a pre-existing (views-generated) block (views_exposed_form) and have the images available in the block's ...
-2
votes
1answer
34 views

how to rearrange a contents type in view?

I have created a view using 8 content type ,then i choose page display setting Display format :Grid full post Settings :number of columns 2 Alignment : vertical Then view like Content A ...