1 |
85ad3d82
|
Assos Assos
|
<p>In this example you will create a <em>Feed display</em> to show nodes by individual users, dynamically selected through the URL. You will become familiar with the Views 2 interface, as well as learn how to use an argument to pull in a user name and use it in a dynamically created path.</p>
|
2 |
|
|
<p>A <em>feed</em> is a data format that places your site's content into a file that can be read and displayed by news reader programs. When visiting a site, you may notice a small <a href="http://drupal.org/misc/feed.png">RSS transmission icon</a>, whereby clicking on it, you can subscribe to the site's most recent content. This makes it easier for your visitors to keep up to date with your website. You can also use this format to aggregate information into other sites. For more information, please watch a video from Common Craft about <a href="http://www.commoncraft.com/rss_plain_english">RSS in plain English</a>.</p>
|
3 |
|
|
<p>Note, Drupal automatically creates a feed for your website, but you may want to create feeds with specific information. In this case, a list per user. </p>
|
4 |
|
|
<ol>
|
5 |
|
|
<li>
|
6 |
|
|
<h3>Creating a new view </h3>
|
7 |
|
|
<ol>
|
8 |
|
|
<li>Go to <a target="_blank" href="base_url:admin/structure/views/add">add new view</a>. Give it the name 'user_feed', description 'A feed of user nodes.', tag 'users', type 'Node' and click Next.</li>
|
9 |
|
|
</ol>
|
10 |
|
|
</li>
|
11 |
|
|
<li><strong>About the Interface.</strong> You have been brought to the Views User Interface. As you start, you are editing the "Default" options for the view. In the 1st column on the left- you can see the pull-down menu offers 'Feed', for example, to select settings specific only to RSS views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options appear below this main area. Most likely, you will need to scroll to see the options appear. As you make changes, these options will appear in bold until you save your view.</li>
|
12 |
|
|
<li>
|
13 |
|
|
<h3>Change default display</h3>
|
14 |
|
|
<ol>
|
15 |
|
|
<li>Under <strong>Basic Settings</strong> in the 2nd column, click <em>Row style: Fields</em></li>
|
16 |
|
|
<li>A menu loads below, <em>Defaults: How should each row in this view be styled</em>, check the <em>Node</em> option, and click <strong>Update</strong>.</li>
|
17 |
|
|
<li>This loads another options menu, <em>Defaults: Row style options</em> click <strong>Update</strong>.</li>
|
18 |
|
|
</ol>
|
19 |
|
|
</li>
|
20 |
|
|
<li>
|
21 |
|
|
<h3>Create the RSS view </h3>
|
22 |
|
|
<ol>
|
23 |
|
|
<li>In the 1st column, select 'Feed' in the drop-down menu, and click <strong>Add Display</strong>.</li>
|
24 |
|
|
<li>Under <strong>Basic Settings </strong>in the 2nd column, click<em> Row style:Missing style plugin</em></li>
|
25 |
|
|
<li>Note, options appear below the Views Interface, you may need to scroll to see <em>Feed: How should each row in this view be styled</em><br />
|
26 |
|
|
tick <strong>Node</strong>, then <strong>Update</strong></li>
|
27 |
|
|
<li>This loads the next options menu- <em>Display type: </em>select "Use default RSS settings", click <strong>Update</strong>.</li>
|
28 |
|
|
</ol>
|
29 |
|
|
</li>
|
30 |
|
|
<li>
|
31 |
|
|
<h3>Set the path for accessing your feed</h3>
|
32 |
|
|
<ol>
|
33 |
|
|
<li> In the 2nd column under <strong>Feed settings</strong>, click <em>Path: None </em></li>
|
34 |
|
|
<li>In options below <em>Feed: The menu path or URL of this view</em> enter in the path with an argument feeds/%/rss.xml</li>
|
35 |
|
|
<li>Click <strong>Update</strong></li>
|
36 |
|
|
</ol>
|
37 |
|
|
</li>
|
38 |
|
|
<li>
|
39 |
|
|
<h3>Set up your arguments to say which user's nodes to display</h3>
|
40 |
|
|
<ol>
|
41 |
|
|
<li>To the right of <strong>Arguments</strong>, click the + sign to add and argument</li>
|
42 |
|
|
<li>In the Feed: Add arguments menu that loads below, select User in the pull-down menu</li>
|
43 |
|
|
<li>Check the box <em>User: Name</em>, click <strong>Add</strong></li>
|
44 |
|
|
<li>Scroll down to options to find <strong>Case in path:</strong> select <em>Lower case</em></li>
|
45 |
|
|
<li>Check the box <em>Transform spaces to dashes in URL</em></li>
|
46 |
|
|
<li>Click <strong>Update default display</strong></li>
|
47 |
|
|
</ol>
|
48 |
|
|
</li>
|
49 |
|
|
<li>
|
50 |
|
|
<h3>Sort to show most recent at top of feed</h3>
|
51 |
|
|
<ol>
|
52 |
|
|
<li>Scroll up to <strong>Sort criteria</strong> in the right most column and click the + icon.</li>
|
53 |
|
|
<li>In the <strong>Groups</strong> drop-down menu below, select 'Node', then check <em>Node: Post date</em>, and click <strong>Add</strong>. </li>
|
54 |
|
|
<li>Select <em>Descending</em> <strong>Sort order</strong>. Click <strong>Update</strong>.</li>
|
55 |
|
|
</ol>
|
56 |
|
|
</li>
|
57 |
|
|
<li>
|
58 |
|
|
<h3>Set filters to hide unpublished entries</h3>
|
59 |
|
|
<ol>
|
60 |
|
|
<li>Click the + icon next to <strong>Filters</strong>. In the options below, select <em>Node</em> under <strong>Groups</strong> drop-down menu, choose the <em>Node: Published</em> filter, and click <strong>Add</strong>.</li>
|
61 |
|
|
<li>Check the box <em>Published</em>. Click <strong>Update default display</strong></li>
|
62 |
|
|
</ol>
|
63 |
|
|
</li>
|
64 |
|
|
<li>
|
65 |
|
|
<h3>Test</h3>
|
66 |
|
|
<ol>
|
67 |
|
|
<li>Click <strong>Save</strong></li>
|
68 |
|
|
<li>Under <strong>Live preview</strong> type in the name of a user, in lowercase, replacing spaces with dashes, click <strong>Preview</strong>.</li>
|
69 |
|
|
<li>You should test and find your feeds at URLs like http://yoursite.com/feeds/user-name/rss.xml</li>
|
70 |
|
|
<li>You can use this path for aggregating on another site. You can also attach the RSS feed to another display of view to make the feed link appear on that display.</li>
|
71 |
|
|
</ol>
|
72 |
|
|
</li>
|
73 |
|
|
</ol> |