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

How to get fields in StylePluginBase

i´m building a new nap view style. I get the map shown correctly, but only without the data of the view :-(. class OpenlayersViews extends StylePluginBase { /** * Whether the display allows the ...
0
votes
0answers
23 views

Drupal7 - In Edit View adding a field, no “Configure: field” popup and field not shown in “Fields” section

In View panel, adding fields not showing up "Configure: field" and the field is not added. i.e. The red-boxed is not shown as below (see step2): Normal behavior step1: Normal behavior step2: The ...
0
votes
0answers
12 views

What is the best way to create uneven grids

I have a a 2-column grid view. They are equally sized but I thought that it would be nice to make one of them 1/3 and other 2/3 on each row. Just like in the example image. What would be the best way ...
0
votes
0answers
37 views

Programmatically get View Field rendered HTML

I need to programmatically read a field output from a View in Drupal 8. The field output has been rewritten with extra text and twig. My code: foreach($view->result as $row){ foreach ($view-&...
0
votes
0answers
30 views

Issue with Views Contextual Filter using Taxonomy Term Name

I've run into an issue with views using contextual filters that feels like a bug but usually when I encounter what appears to be a bug it's because I'm doing something wrong so I wanted to see what ...
0
votes
0answers
6 views

Using views_xml_backend to display an RSS feed with HTML?

The RSS feed has the description field with encoded HTML in it. How do I un-encode the HTML. enable views_xml_backend Create a view of type XML In the view under advanced edit the query parameters ...
1
vote
0answers
29 views

Have Value Selected but Label Showing in Views Display Plugin

I am working on a custom Display plugin for Views. In my buildOptionsForm() method, I have the following: $form['inherit_yaxis'] = [ '#title' => $this->t('The title'), '#type' => 'radios'...
0
votes
1answer
46 views

Raw Field Value in Views

We have a content type that has a Video Embed Field. In this field, we simply enter youtube or Vimeo url. In a custom view we are trying to display the raw value of the field. Since this is a Video ...
0
votes
0answers
12 views

How can I hide a private field from a specific role in webform?

I have 2 roles: wholesaler and owner. i have a webform called "deals". This form has a private field which should be visible to owner only. But this private field still shows to wholesaler role as ...
0
votes
1answer
22 views

Issue with taxonomy term search in Views

I have a View that uses "Search Terms" to search nodes of the content type "Products". I added a new taxonomy term field to the Product nodes, and then added that field to the View. When I use the ...
0
votes
2answers
50 views

How to display article metadata in a custom div?

Metadata (publication date, author's name...) is normally displayed in the "Content" part between the "articles" tags. I have created a new region "titre d'article" in which I would like them to be ...
0
votes
0answers
17 views

Views not showing some content

I have the following code in the footer to a view: <script src="https://mysite/sites/all/libraries/js/listnav/jquery-tablenav.js"></script> <script type = "text/javascript"> (...
0
votes
0answers
40 views

How to create a views contextual filter of the current domain

I'm using the domain module, but have not enabled the submodule 'domain access' because I'm already using open social group access, and want to prevent performance issues. I only need to filter views ...
0
votes
2answers
29 views

Overriding a specific display doesn't work

I created a view in Drupal 8 with 2 displays. I want to keep a display content view mode as teaser and the other as featured (custom), but when I change a display it updates the other display as well.
0
votes
1answer
29 views

Remove a contextual filter programmatically

Is there a way to programmatically remove a contextual filter from a view? I have a view where, at times, I want to display it without the contextual filter active. This is the code I tried. ...
0
votes
1answer
22 views

Searching entity reference field value with Search API

I am using Seach API, Solr Search modules in my website for searching. I've created an index, say 'Blogs index', I've selected blogs content type to index Fields - title, body, Author are added to ...
0
votes
1answer
51 views

How do I print an image field value in views-view.html.twig?

It seems I'm able to print text field values with {{ view.field.field_example.getvalue(view.result[0]) }}, but this same method doesn't work for image fields. Please help.
0
votes
0answers
16 views

Avoid hyphenation of specific word in views text field

In order to avoid hyphenation of a specific word in a text field I can use &zwj; But this doesn't work when the source field type is "Text (plain)" and output in views: the &zwj; is visible. ...
3
votes
1answer
74 views

Execute a view in code and pass multiple arguments to an exposed filter?

I am executing a View in code of a paragraph preprocess to allow dynamic listings. The user selects which content types they would like to show, and the View should return nodes of those types with ...
0
votes
1answer
17 views

Building views relationship with location

I have an article and food content types. I use location module fields in both content types. So for example, when I write an article about restaurants in New York, I choose article's location as ...
0
votes
0answers
8 views

Sort views results by context

Background I have a global site search powered by Search API and Solr. This site search returns a mix of multiple content and file types. Some of these content types have a region taxonomy. Content ...
0
votes
1answer
11 views

Excluding inline images in views

I have a node type with an image field and insert button to get the image into the text field. Then there is a view that is getting the content of the text field and shortening it to 150 characters. ...
0
votes
1answer
17 views

How to add the view name as body class

function THEMENAME_preprocess_views_view(&$variables){ $view = $variables['view']; if($view->name == "YOUR_VIEW_NAME" && $view->current_display == "MACHINE_NAME_OF_VIEW"...
0
votes
0answers
5 views

How can I include the email recipient in my webform VIEW

I am creating a view to show all webforms and some of the data included in the webforms. Is there a way to also pull the email recipient data? (Example: You create a webform, then click on "email" ...
0
votes
0answers
13 views

How to show external PHP in custom module view?

I have created a custom module which contains the hook_block_view and inside that I'm calling a function which only has this code ( the data.php only contains html and php to print a table ): ...
1
vote
1answer
47 views

Can I combine multiple “no results behavior” to avoid repetition?

I have a Search API view that has 3 attachments. This is so I can display different content type results with unique layouts. If the user searches something too specific, they'll see the No Results ...
0
votes
0answers
5 views

multiple view block by term that list node title tagged with child term

I want to display a view where multiple block are specific to first level term of a vocabulary and that it list all the node tagged with all the child term of that term with deep. I could create each ...
0
votes
1answer
20 views

Add link for each column

I'm working on tripal with drupal 7.x I have created new view. i had chosen the fields and i have this table. i want to add the link for each row of the column map Name. i put this tag but i want ...
0
votes
1answer
39 views

How to create unique banner for each node and views page?

What I am trying to achieve: I want the unique banner image for each node and the views page, where the site administrator can simply upload the image and description to upload the banner for each ...
0
votes
2answers
42 views

Views callback work only once with advanced form block

this code work but the views is callback only once (reload only once), any idea to reload more than one time ? see in detail on drupal.org function modulename_form_alter (&$form, &$...
0
votes
0answers
31 views

Custom CSS for Entity Print Views

I need to print Cart form view in drupal 8 site. I have installed Entity Print & Entity Print Views. I can generate pdf successfully using tcpdf pdf file or debug version does not considering css. ...
0
votes
0answers
13 views

One pager for a view with multiple attachments

I am making a custom results page for Search API. To achieve this, I have created a View that pulls 4 items and has a pager set. I also have 3 attachment views that display content from a different ...
0
votes
1answer
34 views

Conditional change row colors [closed]

Say I have a content type "task" with one field "status", which is output by views. Now I want when the status is "finished", the color of that row will be red, when the status is "failed", the color ...
0
votes
2answers
67 views

Print a view inside a block

In Drupal 7, I use the following code to print more than one view inside a block. <?php print views_embed_view('view_name', 'display_name'); ?> In Drupal 8, it doesn't work and it returns ...
-2
votes
1answer
36 views

What search tool to use for data living outside of Drupal on the external API? [closed]

I have an external API with Doctors data. Every doctor item will have: Title Location ( geolocation address ) Opening hours Short description Area of expertise Price range On my Drupal 8 website, I ...
0
votes
0answers
21 views

get fields from a view into twig from a custom display style

So I created a custom display style following a tutorial and enabled fields to be used. I can't, however, figure out what the variables on the twig file should be to display the fields I want. MY ...
0
votes
0answers
14 views

Entity reference view widget in Entityform

i use Drupal 7.64, Entity reference view widget module. Entity reference view widget module perfect work in Nodes entity. But, I can't make it work with Entityform (when new form create in edit mode)...
0
votes
1answer
31 views

REST Export Views and images alternative text

I have a simple REST export View. The View format is set to "Show: Entity". The content type I am exporting contains a standard image field. My image field settings is set to "Enable Alt field" and "...
0
votes
1answer
16 views

How to use view's relationships to pull user entity reference data?

I created 2 new user fields for the user (object/entity) on my D7 site. Using views, I can select 'content' or 'user' for querying data. When I use views to query the 'user', the 2 new fields come up ...
1
vote
1answer
22 views

setHandler into views_pre_render OR count results in views_pre_render

I have a view that needs to have a custom views footer only if it get results. Otherwise the view needs to not be displayed I can set up a view footer by using $view->setHandler with ...
1
vote
2answers
33 views

How do I change the Views (Entity Reference) filter via AJAX?

I have an entity form that allows an admin to select a content type (checkbox) and an autocomplete field that is tapped into a VIEWS Entity Reference (via the Reference Method). Goal: What I would ...
0
votes
1answer
30 views

How to push values from views attachment to Javascript?

I have a table view with both filters and exposed filters, and attached to it there is another view that uses views_aggregator_plus to display a summary of months and different value counts. I want ...
0
votes
1answer
70 views

How to redirect to content if view have 1 result?

Views page show content. How to redirect to content page if views has only one result?
0
votes
0answers
12 views

How to let Drupal Nodejs update views if create/modify node is through AJAX

The purpose to make simple todo list, where user can: Add new todo, Modify his/her existing todo, Mark his/her existing todo completed. all of the above in his/her home page (without going into ...
0
votes
0answers
12 views

How do I alter the existing filter in search api?

In drupal 7, How do I alter the existing filter? For example, I have a node title as an exposed filter and in hook_search_api_query_alter I want if any node title starts with "c" character brings all ...
0
votes
0answers
21 views

trying to insert a view inside a view using twig tweak module

I am trying to insert a view inside a view but struggling a bit I have a view called My Class with all my fields in it, this works fine. I have a view with a contextual filter called Students Block,...
1
vote
2answers
40 views

Creating a view with multiple latest content types

I am looking to create a view for my home page that displays the 3 last added items for 2 different content types (articles and news). Like 2 lists next to each other that also has the option to show ...
0
votes
1answer
39 views

Aggregation problem

I have created a view of node content and I need author name, role, and image to show with content. I have also made a relationship with the user in the advance section for the above-mentioned fields. ...
0
votes
1answer
31 views

Facet - default value with search api

I am using content type in Facet. The search result will be having an option to choose the content type to filter the result. I want the search should show the result with particular content-type ...
0
votes
0answers
18 views

How do I avoid a link is closed within a custom text field too soon

I am creating a custom View for my Search API results page. I have many fields added and they are all set to hidden. This allows me to have a custom text field at the end that can have a unique layout....