Xóa Duplicate Views Results trong Drupal 7

Xóa Duplicate Views Results trong Drupal 7

When you are building a Drupal site and creating views, it's not uncommon to find that your view is showing the same result multiple times.

Here are two common ways to remove duplicate views results.

Option 1: Distinct

This is how Views describes the Distinct option:

"If there are multiple identical items, each will be displayed only once. You can use this to try and remove duplicates from a view, though it does not always work."

  • Open the Advanced area.

  • Next to "Query settings", click "Settings".

Xóa Duplicate Views Results trong Drupal 7

  • Check the boxes, "Distinct" and "Pure Distinct".

media_1389388828163.png

Option 2: Aggregation

Aggregration is often used to perform calculations on field data. For example, you can use Aggregation to count the number of content items in a particular content type. Or you could use it count the average number of comments on your content.

However, if the Distinct option doesn't work, we can use also try to use aggregation to remove duplicate items.

  • Open the Advanced area.

  • Next to "Use aggregation", click "No".

media_1389534990668.png

  • Check the "Aggregate" box.

media_1389535015509.png

  • On the left-hand side of the view, notice that "Aggregation settings" is now an option in several areas.

  • Click "Aggregation settings" for your Filter Criteria.

media_1389536296139.png

  • Choose "Count DISTINCT".

media_1389536331505.png

  • Click on the name of your Filter Criteria.

  • Choose "is equal to" and set "Value" to "1".

media_1389536414529.png

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Khanh Hoang

Khanh Hoang - Kenn

Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
How to batch assign taxonomy terms to nodes using Views Bulk Operations

Hướng dẫn gắn taxonomy terms to nodes sử dụng Views Bulk Operations

First off, make sure you have the 2 modules installed. Drush will quickly take care of that for you if you don't have them yet:

Apple và Samsung sẽ sớm thỏa hiệp?

Apple và Samsung sẽ sớm thỏa hiệp?

Theo cựu Phó giám đốc phát triển của Apple - Jay Elliot, tranh chấp tại phòng xử án giữa Apple và Samsung thực ra chỉ là phần nhỏ trong cuộc chiến chống lại Google của "Quả táo khuyết" và sẽ sớm kết thúc.

27 câu hỏi và câu trả lời từ my first Drupal 8 Building site demo

27 câu hỏi và câu trả lời từ my first Drupal 8 Building site demo

Without the ability to Google my Drupal 8 questions, I had to figure out things by intuition, and by analogy with other components

Công ty diệt chuột T&C

 

Diet con trung