Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [views]

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

0
votes
2answers
25 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
23 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
10 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
33 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
15 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 ‍ But this doesn't work when the source field type is "Text (plain)" and output in views: the ‍ is visible. ...
3
votes
1answer
54 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 ...
-1
votes
0answers
25 views

How to get field value from restricted for user node?

My specific view displays many fields from different nodes, uses many filters too. My problem is that one type of node is restricted for anonymous users but I need to display that field from ...
0
votes
1answer
16 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
16 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
45 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
38 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 ...
-1
votes
0answers
25 views

Provide a field that lets editor select content types?

I have a Paragraph that when rendered, injects a View. This view is being built and constructed in a preprocess hook in the theme, with arguments injected from a field. The field just lists all the ...
1
vote
2answers
37 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
19 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
30 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
62 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
25 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
19 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
12 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
21 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
14 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
16 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 ...
0
votes
1answer
14 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
27 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
55 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
10 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
9 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
17 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
37 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
24 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
24 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....
0
votes
1answer
15 views

D7 block view to only show child nodes based on taxonomy

Using Drupal 7 I have a hierarchical taxonomy each node in the site is assigned a taxonomy to identify where it sits in the site structure. On certain pages (landing pages) I would like to show the ...
0
votes
1answer
29 views

Can't set arguments to a view for displaying all data

I use $view = views_embed_view('export_emargement','page_1',$journee,$region,$produit); it works well, but If I don't want to specify $region the view does'nt works. Im my view admin if I set ...
1
vote
2answers
30 views

How to get my custom module to recognized a exported view?

I have created a view and then exported it normally to a yml file. Then I put this yml file into my mycustommodule/config/install folder. So current its named mycustommodule.view.user_assigned.yml ...
0
votes
2answers
32 views

Filter taxonomy term attached to user field

I have a user that has a taxonomy vocabulary attached their account and a content type with the same taxonomy vocabulary attached to it. How do I get a page view filter to only display the nodes that ...
0
votes
0answers
13 views

Taxonomy terms not localized in view with enabled aggregation

On a view on content, I added a field "All taxonomy terms" (Display all taxonomy terms associated with a node from specified vocabularies) and enabled aggregation, see screenshot of view attached. ...
0
votes
0answers
37 views

How to get translated term name from TID in views field template?

For a complex view, I need to alter the output of a localized term field: instead of putting out the TID of the term, I would like to render the localized term name. Does someone know how to alter the ...
0
votes
0answers
29 views

Replacing a specific content creation with the newest version

I'm creating a website that tracks users weight. A user can create content to enter their weight and I have a view that displays all entries of a users weight however I want it so that if a user makes ...
0
votes
0answers
16 views

Filter content moderation view according to user roles that I currently login to the site

The view I try to filter is only accessible to authenticated users and they have defined roles, that is, it is an administration view. I have several types of content and I want to show in the ...
0
votes
1answer
36 views

Adding a custom data-attribute to a field in Views

In a view I need to add a custom data-attribute to the row output (just like classes are added). Simply rewriting the output doesn't work because XSS attribute filtering strips the attribute. How can ...
0
votes
2answers
19 views

Create a view on a entity using criteria on another entity

I'm trying to this done : I have two entities 1) Listing Details 2) Listing Premium Settings. This entity references the first Listing Details entity. In the second Entity I have referenced entity ...
0
votes
2answers
52 views

Getting a view of unique years of a date field

I'm tasked with creating a Year filter for our press releases page. We're using the Article content type, to which we've added a field called Release Date. We have the press releases as a block ...