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

 
Workshop Photography - Cú bấm máy & Chuyện hậu kỳ trong nhiếp ảnh

Workshop Photography - Cú bấm máy & Chuyện hậu kỳ trong nhiếp ảnh

Buổi Workshop diễn ra vào lúc 9h sáng chủ nhật ngày 10/11/2019. Tại Văn phòng Keyframe : 06 Phan Đình Giót, P2, Q Tân Bình.

Upgrading Eclipse on Ubuntu (from 3.5 to 3.7 indigo – works for other versions too)

Upgrading Eclipse on Ubuntu (from 3.5 to 3.7 indigo – works for other versions too)

After upgrading my Ubuntu version to 11.04 I installed eclipse using the software centre.

Google bán Motorola Home cho Arris với giá 2,35 tỉ USD

Google bán Motorola Home cho Arris với giá 2,35 tỉ USD

Sau khi có một số hành động cho hoạt động tái cơ cấu Motorola Mobility, Google tiếp tục bán Motorola Home, một chi nhánh của Motorola Mobility, cho Arris với giá 2,35 tỉ USD.

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

 

Diet con trung