Skill Level: 
Advanced

When the Aggregator module does not provide enough flexibility, such as displaying images from a feed or order a feed by criteria other than date.

A. Set up a Feed and Feed Item content type

  1. On the Administration toolbar, click Structure.
  2. Click the Content types link.
  3. For Feed (Machine name: feed), click the edit link in the OPERATIONS column.
  4. In the settings and options section, click Display Settings.
  5. Deselect Display author and date information.
  6. Click Save content type. You'll return to the Content types page.
  7. For Feed item (Machine name: feed_item), click the edit link in the OPERATIONS column.
  8. In the settings and options section, click Display Settings.
  9. Deselect Display author and date information.
  10. Click Save content type.

[optional] Feeds Image Grabber

Only perform these steps if images will be a part of the feed.

  1. On the Administration toolbar, click Structure.
  2. Click the Content types link.
  3. For Feed item (Machine name: feed_item), click the manage fields link in the OPERATIONS column.
    1. LABEL:  Type Image for the new field name.
    2. MACHINE NAME:  Click the [Edit] link and type field_feed_item_image.
    3. FIELD TYPE:  Choose Image from the drop-down menu.
    4. WIDGET:  Will populate when you select the field type.Add new field
  4. Complete the fields.
  5. Click Save when complete. You will now be able to edit the feed item image.
  6. [optional] You may choose to specify a File directory, such as feeds/images, if you wish.
  7. Click Save field settings.

B. Turn on Link

  1. On the Administration toolbar, click Structure.
  2. Click the Content types link.
  3. For Feed item (Machine name: feed_item), click the manage fields link in the OPERATIONS column.
    1. LABEL:  Type Link for the new field name.
    2. MACHINE NAME:  Click the [Edit] link and type field_feed_item_link.
    3. FIELD TYPE:  Choose Link from the drop-down menu.
    4. WIDGET:  Will populate when you select the field type.
  4. Click Save when complete. There are no field settings for this.
  5. Click Save field settings.
  6. Leave settings as they are (some will be blank) and click Save settings.

C. Turn on Feed

  1. On the Administration toolbar, click Structure.
  2. Click the Feeds importers link.
  3. Click the Override link in the OPERATIONS column for Feed.
  4. Click the Settings link for the Node processor
    1. Select Replace existing nodes.
    2. Change the text format to HTML.
    3. Click Save.
  5. Click the Mapping link for the Node processor
    1. SOURCE:  Select Item URL (link) from the drop-down list.
    2. TARGET:  Select Link: URL from the drop-down list.
    3. Click Add at the end of the row.
    4. [for Images] SOURCE:  Select Item URL (link) from the drop-down list.
    5. [for Images] TARGET:  Select Image (FIG) from the drop-down list.
    6. [for Images] Click Add at the end of the row.
  6. Click Save at the bottom of the screen.

D. Import your first feed

  1. On the Shortcuts menu, click Add Content.
  2. Click the Feed link.
  3. Enter your feed's Title and provide the URL in the FEED section.
  4. [optional] Click the FEEDS IMAGE GRABBER section title to expand.

    1. Select Enable Feeds Image Grabber.
    2. If you know the ID or Class of the images on the page, select the appropriate option and then provide the ID or Class of the HTML tag.
    3. Note: Feeds Image Grabber does not pull image links from the feed. It scrapes the webpage linked in the feed.

E. Create a View with a Block display

Now that the feed is imported, it has a View Page already created, but we want a View Block as well to display in the sidebar.

View page

  1. On the Administration toolbar, click Structure.
  2. Click the Views link.
  3. Click the + Add new view link at the top of the page.
  4. Enter the View name (same as the title in the previous steps).
  5. Deselect Create a page.
  6. Select Create a block.
  7. Click Continue & edit.
  8. Next to FILTER CRITERIA, click add.
  9. Select Feeds item: Owner feed nid (near the bottom of the list).
  10. Click Apply (all displays).
    1. On the Administration toolbar, click Configuration.
    2. In the SEARCH AND METADATA block, click the URL aliases link.
    3. Locate the feed you created and the numerical value of the node is in the SYSTEM column.
  11. In the Value field, type the numerical value of the node created above. (Follow the steps below to find the value.)
  12. Click Apply (all displays).

Edit the Block Details

  1. On the Administration toolbar, click Structure.
  2. Click the Views link.
  3. For the feed you have added, click editin the OPERATIONS column.
  4. Under the FIELDS section, click the add button and select the following:
    1. Content: Link (Link) 
    2. Content: Title 
    3. Content: Description (Description) 
    4. [optional] Content: Image (Image)
  5. Click Apply (all displays).
  6. Configure the fields as indicated below.
    1. Click Content: Title 
    2. Click REWRITE RESULTS to expand the section.
    3. Select Output this field as a link
    4. In the Link path field, type:  [field_feed_item_link]
    5. Select Use absolute path.
    6. Select External server URL.
    7. Click Apply (all displays).
    8. Click Content: Link (Link) 
    9. Select Exclude from display.
    10. Click Apply (all displays).

Add the News Feed block to the Sidebar

  1. On the Administration toolbar, click Structure.
  2. Click the Blocks link.
  3. Drag you new block into one of the sidebar regions.
Contributed By: 
IIM

Comments

dthayer2's photo

Following the instructions here, I received the message:

These settings apply to the Link field everywhere it is used. These settings impact the way that data is stored in the database and cannot be changed once data has been created.

Link has no field settings.

To address this, I went to the Edit link under Operations and set the Link Field Settings to Unlimited. Following this, I did not receive the error message.

dthayer2's photo

"Replace existing nodes" does not exist in the OPERATIONS link for Feed, but I found it under the Settings link for the Node processor. I did not find SOURCE or TARGET dropdowns under the Settings link for the Node processor. These were under the Mapping link for the Node processor. I think you got some of your steps mixed up.