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
1answer
4 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
11 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
16 views

View filter settings not selected properly in production environment

I have a group of block views for various program pages on my site which have a filter for an area of interest. Within my "Area of Interest" taxonomy term are numerous areas for the different groups. ...
0
votes
0answers
4 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 ): ...
0
votes
0answers
22 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
4 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
16 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
35 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
16 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
0answers
20 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
16 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
11 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
22 views

Conditional change row colors

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
46 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
23 views

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

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
18 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
11 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
17 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
13 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
0answers
15 views

Hide Parent Terms in Taxonomy Term View Block in Twig

Trying to hide the top two terms (or first two levels) in my org listing via twig. The listing itself is a view block using the term reference tree formatter.
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
20 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
52 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
9 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
8 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
38 views

Should I disable the page cache and keep dynamic page cache? [closed]

Drupal max-age tag does not work with anon. I also am not looking to use a replacement for page cache as of now .. Can I remove page cache and just use dynamic - wouldknt this fix problem? The kill ...
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
36 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
20 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
20 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
28 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
29 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
29 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
11 views

Drupal How to lay out admin content to page?

Is there any option to lay out content displayed in this screenshot: on the page of the website:
0
votes
0answers
13 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
27 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
44 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 ...
0
votes
0answers
11 views

in my view user count field not displaying properly to site members, but displaying properly to admin

I have tried to achieve total og group members count and users count in a view. detail and complete information on this link user count and posts count in a og view in my case in above link comment ...
0
votes
1answer
67 views

Rewriting image output in views: how to provide replacement pattern inside twig tag?

In views I want to rewrite output of image field by using twig function drupal_image (see module Twig Tweak). When I provide the image path directly, this code works: {{ drupal_image('public://...
0
votes
1answer
57 views

Programmatically get the results of a view

Using the group module in D8, I have the below view with machine name: group_members_per_group Machine Name of: (Member account) User: Full Name is: field_user_full_name (Member account) User: ...
0
votes
0answers
9 views

Is it possible to use hook_views_query_alter to compare the value of two fields?

We have a D8 site with a view that links a Content-->Paragraph-->Content. We also have language translation enabled so the views_ui module displays duplicate rows for all combinations for the content ...
0
votes
0answers
17 views

Views : Contextual filter on reference?

I can filter the View by using Contextual filter on a normal field, but when the Ctx-filter is set to use Reference field the filtering does not work. F.e. let say I have two content types A and B, ...