Hướng dẫn exposed Filters với Views 3 trong Drupal 7

Hướng dẫn exposed Filters với Views 3 trong Drupal 7

With views, it's easy to create a restricted listing of content. What's more, you can also expose those filters to the user, so they can sort and filter the content themselves. Here's an example of the type of functionality you can enable with "exposed filters":

Hướng dẫn exposed Filters với Views 3 trong Drupal 7

So here's how you set up a simple exposed filter, using Views 3 in Drupal 7:

1. Make sure views is installed, and enabled, and that you're looking at the admin screen of the view you are interested in.

2. Create the filter criteria that we want our users to be able to control, by clicking the "Add" button, in the filter criteria box.

3. I want to expose a filter that allows users to choose which content types are listed, so for my filter criteria, I'll check Content: Type, and click "Apply".

4. On the next screen, check the option "Expose this filter to visitors, to allow them to change it. There are lots of other options, but I'll just leave it at the defaults and click "Apply".

5. Now you can scroll to the bottom of your views admin page and click "Preview" to see a demo of the functionality. Use the select box under "Type" to choose the content type, and click "Apply" to repopulate the view. It works!

6. We can click Save, to save the view, and browse to the path we defined ("/my-new-view"), to see it on the site.

A basic example of Drupal exposed views.

And that's it! This is the foundation for all kinds of user defined filtering that you can set up. Go forth and build!

Additional resources:

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

 
Giới thiệu sơ lược Apache Hadoop

Giới thiệu sơ lược Apache Hadoop

Các cỗ máy tìm kiếm như Google chọn lọc thông tin và trả về kết quả trong tích tắc. Kỹ thuật thường được sử dụng là chia nhỏ nhiệm vụ(job) để hàng loạt máy tính cùng nhau thực hiện. Kỹ thuật này cũng được biết đến với tên gọi Cloud computing. Tìm hiểu hadoop sẽ giúp chúng ta làm quen với Cloud computing.

Cài đặt máy chủ DNS và Domain Controller trong Windows Server 2003

Cài đặt máy chủ DNS và Domain Controller trong Windows Server 2003

Windows Server 2003 gồm có tất cả các chức năng mà khách hàng mong đợi từ một hệ điều hành Windows Server, chẳng hạn như khả năng bảo mật, độ tin cậy, khả năng có sẵn và nâng cấp.

HTC Salsa: A Review

HTC Salsa: A Review

The name salsa sounds fun, warm an inviting, and yes, it is true of the HTC Salsa. The first thing that caught my eye was the build quality.

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

 

Diet con trung