Using Drupal 6 views module series (2)

Source: Internet
Author: User
Tags drupal

Original article: http://blog.sina.com.cn/s/blog_48a770da0100gam5.html

Rare and rare Chinese Drupal view detailed tutorial, transferred from http://www.cc.ntu.edu.tw/chinese/epaper/0009/20090620_9009.htm

Author: programming organization for Educational Research Groups at Tang xuanyuan university computer and network-based Education Center

In this article, we will introduce?The large functions and usage of arguments, relationships and sort criteria in.

Connect to modules... use Drupal 6 views module series (1)
Zookeeper strives to set up...

The settings of the extension series (1) are first returned to the music view navigation pane.?In the drop-down list, the feed, block, and attachment cases have not yet been added.KBoth arguments, relationships, and sort criteria are none defined. We will introduce these features and usage methods in this series (II.
Series (1) The following is the surface of the last set plane:

Starting from sort criteria
If you have not set any sort rules for the style in basic settings, you can add the sort bit you want to use in this area, and set from small to large or from large to small. For example, if we want to display recently updated files, the closer we want to put the modified files to the top.
1. Please add an sort criteria "content delivery point: Updated Date" and press add.
2. The sort order is descending.
3. Time granularity (granularity) can be adjusted to minute. Click Update and save view.

Set arguments
If we want to generate the results of views, we can add the number after the URL, which is similar to the filter effect, this allows the user to initiate a small query to lead to a certain singer. The settings are as follows:
1. In the arguments region, press □+ to add
2. Because we want to use the Author ID as the argument selection, select the content selection point in the group drop-down list and check the content selection point: NID.
3. Press add and then press upload.

4. Criterion: % 1 will be set to the first dynamic node title during the presentation. Similarly, % 2 is the second metric. In this example, % 1 indicates the title of author, that is, the name.
5. wildcard setting: Set the wildcard value and title first. Wildcard refers to all results. Here we set wildcard as "all ".
6. Set action to take if argument is not present values to provide default argument. When the user does not fill in any metric data in the website column, we will give the preset value. This role has a choice for summary. This feature is very large, so he will summary all the possible values of this view, and provide the links for each vertex to be added.
7. there are multiple types of parameter settings, such as fixed values, node IDs or user IDs taken from URLs, here we set the order to a fixed value "all ".

8. Setting the parameter value of the Verification Code: Set the allowed parameter value to artist, that is, the parameter value must be the artist node ID.
9. List the summary when the number is provided, but the value does not comply with the certificate requirements.

10. Final setting: Check allow multiple terms per argument. This parameter is intended to bring the results of multiple views at the same time. The combination of values can be '+' or ','.

11. data Usage and result analysis: in the browser, enter the following URL, where allmusic is the path to display 'all music posts page; 137 is the node ID of the artist content type. Its title is Zhou Jie. After the click selection, you will see the introduction of Zhou jiejie and all the works.
Http://140.112.XX.XX/drupal? Q= allmusic/137

Relationships
The views 2 parameter settings contain some relationship settings for our convenience. In our example, there is a label in the artist content type as an example, and the type: node reference parameter bit is field_created_song pointing to the song content type. Therefore, if we use artist as the key, we can easily bring all the operators (songs). If we use song as the key, how can we bring the author (artist) what about it? At this time, the relationship was deployed on the site.
1. Add a new display named song2artist and add relationships.
2. Select parameter content: specify as-(field_created_song) and press Add button.

3. Enter "complete" in the label fields ".
4. Check "require this relationship ".
5. Set Delta value to all. This parameter indicates that if more than one result is taken, the number of selected parameters is 1st, 2nd, or all.
6. Press update.

7. Set argument: when there is a relationship, there will be an extra set parameter. Here we choose to use the "parameter" relationship.

8. Start to set the field locations to be displayed: First add the first content storage location: Question.
9. You can choose to use the "networking" relationship.
10. Set the label to "song name ".

11. added the second bit: internal volume usage: This article.
12. Select the relationship "serving.
13. Set the label to the "lyrics ".

14. added a third ranking bit: Internal ranking point: goal.
15. Relationship setting: Do not use a relationship.
16. Set the label to "author ".
17. The updated memory is saved.
18. When should field use relationship? Because Song cannot directly bring artist-related information, as long as it is related to the song, for example, you must use relationship. In contrast, artist does not need to use relationship to bring the author's name.

19. The final settings are as follows. In the arguments and fields region, as long as there is a forward bit, this relationship is used, it can be seen that all the data is Song's content type.

20. The path of the display is set to s2a. If the following is entered in the URL scheme and a song node ID is included, the subsequent display is shown. Http://140.112.XX.XX/drupal? Q = s2a/130

Fun advance settings
Basically, there are too many views2 module configurations, and various types of combinations are provided for developers to use. We only recommend the menu tab and filter expose for the attacker this time. The settings are as follows:
1. In the previous example, we already have two displays, namely, "All music posts page" and "sing2artist ".
2. Change the path of "all music posts page" to musictab/allmusic. All menu tab items must have a parent menu. The method of identification is to call the common path musictab.

3. Set the menu item of "all music posts page" to the default menu tab, and set the sequence to 0, indicating that the leftmost tab appears.

4. Default tab Options settings: Set parent menu item to display. Select normal menu item, set the item, and save the updated item.

5. Next, set the path of "song2artist" to musictab/s2a, indicating that the menu tab appears.

6. Set the menu option for "song2artist". Select the menu tab and set the sequence to 1.

7. After memory is saved to the left-side Navigation Pane, the "audio and audio" menu will be found, or the following will be entered in the URL layout:
Http://140.112.X.XX/drupal? Q = musictab
A simple menu tabs completes the upload.

8. filter's expose setting: this setting is very easy to use by providing users with their own data retrieval. Here, we use the "song2artist" display plane as an example.
9. Add filters settings: Please select internal content setting point: subject.

10. Because it is selected based on the song standard, please use the relationship.
11. Press the expose button.

12. Operator setting: because we want to make a selection based on the keyword "keyword" in the song name, please select contains.
13. Select two checkboxes (option) and remember. In case sensitive, uncheck this option.
14. Set the label to "keyword of the curve name :".

15. Add the following network addresses, or select 2nd menu tabs from audio streams. All song nodes will appear. Please insert a first (all or part) in your resource information in the "keyword", and press the Apply button to bring the information.
Http://140.112.X.XX/drupal? Q = musictab/s2a

Conclusion
The WordPress Mu website, which is one of the most popular open source websites, has the following sentence: The possibilities are only limited by your imagination. I personally think it is very useful to everyone!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.