Hướng dẫn tạo 1 Personalized Content Feeds trong Drupal 7

Hướng dẫn tạo 1 Personalized Content Feeds trong Drupal 7

One of our members wanted to allow users to create customized information feeds in Drupal.

In this tutorial, we'll show you how to do that. We'll demonstrate how to allow users to view only certain types of content.

This could be useful for news sites, but also for many other types of site where users want personalized content.

In this example, we're going to create a page of movies. Users will be able to choose to see movies only in genres that they choose.

Step #1. Taxonomy

Our first step will be to create a vocabulary and terms that will link the users to content.

  • Go to Structure > Taxonomy.
  • Create a Vocabulary and add terms. In this example, our vocabulary is "Movie Genres" and our terms are specific genres:

media_1398177342476.png

Step #2. Add the Taxonomy to Content and User Profiles

Now let's add the new taxonomy to our content:

  • Go to Structure > Content types.
  • Add the Movie Genre vocabulary to a content type. In this example, we have a content type called Movies:

media_1398177495450.png

Next, we're going to add the taxonomy to our user profiles also:

  • Go to Configuration > People > Account settings.
  • Click the Manage Fields tab.
  • Add the Movie Genre vocabulary:

media_1398177585688.png

Step #3. Create the view

Now we're going to create the timeline with Views:

  • Go to Structure > Views > Add new view.
  • Create a view that shows Users:

media_1398177821531.png

  • Click Add next to Contextual Filters.
  • Add a contextual filter for "User: Uid".

This will allow us to pull information based on the user who is looking at the view.

media_1398178031380.png

  • Click Add next to Relationships.
  • Add the relationship "Movies You Like" from the User Profile.
  • Add the relationship "Taxonomy term: Content using Movie Genre".

This will allow us to pull in the fields from the content type, even if this view was initially designed to show users.

media_1398178156284.png

Now we can add the fields we want from the movies content type. I'll add the Title and the Body:

media_1398178394017.png

  • Save the view.

Step #4. Test the view

The fastest way to test this set up is to edit your own user profile:

  • Click your name in the top-right corner of the admin bar:

media_1398111095086.png

  • Click the Edit tab.
  • Add Movie Genres to your profile:

media_1398111112699.png

Now you can visit the view that you created in Step 3 and test whether its working.

media_1398178560288.png

 

Bạn thấy bài viết này như thế nào?: 
Average: 5 (1 vote)
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

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

 
iPad Mini Retina và iPhone giá rẻ sẽ bắt đầu xuất xưởng từ tháng 8

iPad Mini Retina và iPhone giá rẻ sẽ bắt đầu xuất xưởng từ tháng 8

Các báo cáo mới nhất cho biết, các lô hàng iPhone giá rẻ và iPad Mini Retina sẽ sớm được xuất xưởng vào khoảng thời gian cuối hè, tức tháng 8, để chuẩn bị cho sự ra mắt của cả hai thiết bị trong mùa thu này.

Mọi khó khăn đều là quà tặng - đáng xem những gì thế giới thay đổi

Mọi khó khăn đều là quà tặng - đáng xem những gì thế giới thay đổi

Thế giới thay đổi rất nhanh, những cái cũ không còn phù hợp sẽ được thay thế bằng cái mới tốt hơn

Portal chuyên gia, e-Marketplace portal tạo ra thế giới internet thu nhỏ

Portal chuyên gia, e-Marketplace portal tạo ra thế giới internet thu nhỏ

Ngày nay khái niệm portal không chỉ áp dụng cho các ‘gã khổng lồ truyền thông’ kể trên, nguyên lý một đầu mối cho tất cả đã được áp dụng vào việc nâng cấp,

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

 

Diet con trung