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

How can I set Focal Point coordinates in a View or Twig?

I use the Focal Point module in D8, and I'm trying to figure out how I can access the X and Y coordinates of the focal point through Twig in either a view or Twig template so I can use them as ...
1
vote
1answer
51 views

{{ drupal_view('view1', 'block_2') }} renders only when cache is cleared

I like to output 2 block-views in a template called "block--bar.html.twig", but only when i clear the cache they are printed. (i installed Twig Tweak 8.x-2.x) This is the template: <section{{ ...
0
votes
0answers
12 views

how bulk change each content type groups membership

i have a content type named students. Each student must only be in a single group. I noticed many students belong to two groups. How can i delete the second group, for each node of content type ...
1
vote
1answer
77 views

How to set an exposed filter to enable current user to view nodes that he has not commented

On my D7 site I am trying to create an exposed filter where current users would choose whether he wants to see all nodes, or only those that current users have not commented. Tried adding 'Comment: ...
0
votes
0answers
41 views

Hide Specific block when search is performed with Expose Filters in Drupal 8.8

I have made a custom view which will show Results based on the selected expose filters. I can access that VIEW on my local machine as: http://drupal881/home On leftside bar, I have some filters and ...
0
votes
0answers
16 views

How to exclude an user previously referenced in a field (User reference) from a Views block listing users?

Using Drupal 7.69 I have built a views block to list all users from a team, based on a taxonomy field as contextual filter (the team content type and users share the same taxonomy field). This block ...
0
votes
0answers
16 views

How to place a view under a local task tab?

For my Drupal 8 project for user view /user/* I have created one custom tab in the local tasks "Manage school": $data['tabs'][0]['user.manage_school'] = array( '#theme' => 'menu_local_task',...
0
votes
1answer
27 views

View should show related articles from shared reference field - relation from a relation

I have two content types: Article and Magazine. in Article there's an entity reference field to Magazine, field_related_magazines. On my website, when an article is shown, I would like to show a list ...
0
votes
1answer
26 views

How can I print the file size and other file info in a Views field template?

I have created a content type with a number of fields including file fields. In the node template for that CT (node--unit.html.twig) I am able to get the details with the following code: {% if ...
0
votes
0answers
4 views

trying to merge 2 views with same fields into one output

Im using views 7.3 I have two views and tring to merge them both as outlined here https://drupal.stackexchange.com/a/212340/79382 I have created a module and included two files. foo_view_merge.info ...
-1
votes
1answer
18 views

How to display only those nodes that current user has commented

On my D7 site I am trying to enable users to view the nodes where they have submitted their comments. I have tried adding 'Comments of the node' relationship, then added 'Comment: Author' and 'Comment:...
0
votes
0answers
18 views

how cache a view that has a field that is calculated with php code

i have a view, that returns results based on a data field, that calculated the number of nodes that fulfill certain criteria, an important one is that the numbers are calculated based on the group the ...
0
votes
0answers
13 views

drupal 7 views with 2 different contextual relationships?

I am using Drupal 7 with views. I have a view of all content from Organic Groups which the user is a member of. And a view of all content by users the current user has flagged. I am trying to get ...
0
votes
1answer
29 views

On content, choose the taxonomy parent and display all the children

I have a content type with a taxonomy field based on a hierarchical taxonomy with 3 levels. I use Simple Hierarchical Select (SHS) to select and display the terms. I want to have a view that ...
0
votes
1answer
18 views

Combined Fields filters and missing custom search api fields

Drupal 8 I am using Search API and Views to search several fields from several content and media types. For example, I have a custom "description" field for Media->files so users can add a searchable ...
0
votes
0answers
13 views

Views field showing raw HTML rather than processed

I have a view set to display fields. One of the fields is a long text field with selectable text inputs. When displaying this on the front-end, regardless of what is selected as formatter (trimmed/...
0
votes
1answer
28 views

How to change the condition operator in the search api query?

I have a date field facet filter on my search api views page. When I select a date in the filter, the search api display those results which has that date value selected in the date field. I want to ...
1
vote
1answer
25 views

How to get rid of large classes with numbers from views?

Which is the purpose of classes like that one: class="js-view-dom-id-0fc70eec09ba01f6b7c7867ee7e19f7dcec1ee8b64de9dc8b791865caf299ec7" It's safe to change this class from twig templates? Thanks.
0
votes
1answer
34 views

Hide/remove js-view-dom-id in just one specific view

I found, that the div with the id "js-view-dom-id" comes from views-view.html.twig. As I want to render one view output without any of Drupals HTML markup, I already hunted down the contextual links, ...
0
votes
1answer
20 views

Aggregation with count that includes empty field values

I saw other questions regarding the aggregation but i didn't found anything similar to what i need. I've a view with enabled the aggregation, results are grouped by a field value (a text field) with ...
0
votes
0answers
48 views

how to get translated content in twig [views.view.unformatted]?

I am trying to get translated node title in my custom views-view-unformatted twig file. Here is the way I am retrieving my node title in twig file <div class="col-md-6 title"> {% for row ...
1
vote
1answer
10 views

Group content by taxonomy term, but then also list all terms in each row

I'm looking for help with creating a view. I have a content type, Thing. Thing has a field on it where you can select multiple terms in a taxonomy, Category. I want my view to look like this: ...
0
votes
0answers
12 views

Duplicate grouping title is showing on load more

I am working for an aggregator site. I need to show data by group with different taxonomy term title. I also need to theme that display. So far I am close to layout and functionalities except on load ...
0
votes
0answers
7 views

Inherit pager on views attachment not working with offset

I have set up a view (7.x-3.21) that lists a number of blog-posts where the first N are more detailed, and a number of others only date and title. This works so far, but setting up a meaningful pager ...
1
vote
1answer
35 views

How to add a Custom Serializer to alter the Output of REST EXPORT

To the Response/Output of REST EXPORT of a view, I want to add one extra row. So I created a Custom Serializer in my module. The path of the file is: My_Module/src/Plugin/views/style/...
0
votes
0answers
20 views

Webform submissions taxonomy term view

Working on a new Drupal 8 site. I have a taxonomy vocabulary called Affiliates, and all users are tagged with a single Affiliate. I'd like to create a view that shows all webform submissions for that ...
1
vote
1answer
82 views

Using taxonomy exposed filter in a view ends in MySQL can only use 61 tables in a join

Scenario One hierarchical vocabulary called Countries with 300 taxonomy terms, one for each country, indenting like: America (level 1) Anguila (level 2) Antigua y barbuda (level 2) ... (level 2) ...
0
votes
0answers
21 views

How do you reference Font Awesome in the CSS of your drupal site?

I have installed the Awesome Font module, and it uses the external file location: https://use.fontawesome.com/releases/v5.12.0/js/all.js In my css I entered the following: .bs-region--top::after { ...
0
votes
1answer
26 views

Call another field inside preprocess_views_view_field

how can I access the value of another field inside the preprocess_views_view_field. This is an example: function THEMENAME_preprocess_views_view_field(&$variables) { $view = $variables['view']; $...
0
votes
1answer
18 views

Send view field in URL - Drupal

I have a search page created with embedded filters in Drupal 8 View. In the list of fields I have a fields - [Field_program_id]. I also have a button 'Learn more' when clicking this button I want to ...
0
votes
0answers
9 views

Search API File search missing filter operators

D8 Webiste Probably missing something obvious here but... I am trying to create a view that can search an index generated by Search API. I want to include files in the search. Ideally with an ...
1
vote
0answers
46 views

Why can't I remove the %20 from a URL evaluated by a contextual filter?

I created a view with contextual filters with taxonomy terms that have two words, so that space creates a %20 on the URL. I found out that the solution is to checked the "Transform spaces to dashes in ...
0
votes
0answers
13 views

Custom views filter plugin: cachetags invalidation does not effect option list

I described a custom views filter plugin extending InOperator. The aim is to offer a select list where the user can choose from a list of fractions of a legislature. Legislature and fractions are ...
2
votes
1answer
58 views

How to get total number of rows on a block of a view

On hook_block_view_alter() I need to get a total number of rows that this block displays. For example, I have a view with the following block: On hook_block_view_alter() I do the appropriate checks ...
0
votes
0answers
8 views

Views Grouped filters using Relationships and Allow Multiple Selection

I have a View with Grouped filters using a Relationship and allow multiple selection options, however, it does not render multiple selections results
0
votes
0answers
14 views

Views contextual filter allow multiple values not available

I'm building a view to see some webform results. I'm trying to add a contextual filter to limit results to certain values entered in a field, but the option to allow multiple values is not allowed. ...
0
votes
1answer
51 views

Can we access paragraph field in views-view-unformatted.twig?

Is there a way to access the fields in paragraph in views-view-unformatted.twig. I want to perform checking on field of paragraph before print the row something like this {% for row in rows %} {% ...
0
votes
0answers
36 views

Configuration Import Error

I have a drupal8 in local system. I want to import my production environment configurations into my local. So i am running drush cim -y I got the following error. Unexpected error during import ...
0
votes
0answers
8 views

Need help with View Merge Rows, rows not merging

I'm using Order Reports and each of the report items (promotions, sales tax, order items) are in the order reports as separate line items. I need to combine all the line items with the same order ...
0
votes
0answers
13 views

View filter criterion: D7 -> D8 equivalents

I am creating new views in Drupal 8 to replicate ones from a previous D7 installation. Under D7 "File: Type" our operator choice was "is one of." Which of the following is the closest D8 equivalent? ...
0
votes
0answers
11 views

How can I update view's exposed filters on user selection

I have a view which has to taxonomy filters exposed, lets say "Tax 1" and "Tax 2". The filters are set as selections. Now lets say that the user selects one of the items of Tax 1. Now the content ...
1
vote
1answer
40 views

How to access link fields (url and text) value separately in views template?

My views block has a Link field named field_link, attached to a Content Type named products, and I'm trying access link field values(url and text) separately in views template views-view-unformatted....
0
votes
1answer
15 views

Fully display only most recent post on front page, furl the others

Currently my Front page will only show a teaser for all my new posts. I know that I can go to Structure > Views > Frontpage and change it to show Content | Full which will show the full post of ...
0
votes
0answers
17 views

How to trim a Full HTML format field value, which can be used inside hook_preprocess_views_view_field(&$vars)

I have created a Taxonomy View that has a Global : Custom Text field, using hook_preprocess_views_view_field I'm placing other field's values with some customized markup in that field. Now what I ...
2
votes
1answer
32 views

How can I use a replacement pattern in a custom field?

I just created a new custom field in a view, but I would like to use replacement patterns in that field. Is it possible to do this? class CustomButtonField extends FieldPluginBase { /** * {@...
0
votes
1answer
29 views

Sort by taxonomy weight

I have a content type 'Member' with a field referring to taxonomy term called 'Member role' which is a multi value field. Each member may have up to 3 member roles. I have created a view to display ...
0
votes
1answer
61 views

Use hook_views_pre_render() to change field to url link

I want to use hook_views_pre_render() to read in a view and change a field output to a clickable link. Here is code: function sbn_views_pre_render(ViewExecutable $view) { // https://drupal....
0
votes
0answers
35 views

How can I print just one field of a view in a block template? [duplicate]

I created a view block that is "more by this author" and was able to configure the view so that it pulls the author of the current node and shows more pieces of content by that author. Hurray! I ...
0
votes
1answer
15 views

How do use hook_views_pre_render() to modify view fields

Want to use hook_views_pre_render() to modify a field in view based upon data in another field. Starting with this code: function sbn_views_pre_render(ViewExecutable $view) { drupal_set_message($...
0
votes
0answers
8 views

Adding a new field to the layout_builder_update_block/layout_builder_add_block for a view block for usage later

We are using layout builder for adding view blocks to node pages. I need to modify the "add/update" form with a new boolean field (checkbox), and use the results that are stored (true/false) later on ...