Hello,

I have an RSS feed being displayed as a block on my front page and I use an image that includes the name of the site that the feed data is coming from.

The aggregator.module requires that you give a Title to a feed in /admin/aggregator/edit/feed/. This title is displayed prior to the feed items. I would like to stop this, and only show the feed items since my image I'm displaying in the block already gives the name of the site the news comes from.

I tried first looking for theme possibilities. I wasn't able to find a themeable function in aggregator.module that would allow this. The closest is theme_aggregator_block_item, which let's you tune the individual link items.

I went into the source for aggregator.module and looked for all items using the h2 tag, since the title is outputted surrounded by these tags. Unfortunately, it appears that the two areas in the source where h2 appears refer to how the feed information is outputted on the administration screens--commenting out these lines did not work.

So, what the heck? How can I get rid of or otherwise format these h2 feed titles? Should I be using aggregator2 instead? Am I missing a themable function in aggregator.module that would solve my problem?

Thanks so much.

rob

Comments

jetsetter’s picture

Can anyone help me with this?

jetsetter’s picture

I found out that I can use the space character " " as the title and it of course, doesn't show anything.

This is a terribly inelegant solution though. It would be nice to change the code the shows the RSS items, so that they're not in a bulleted listed for instance.

I'd really appreciate any ideas anyone has on this topic, as I can't figure it out.

rob

jetsetter’s picture

OK!

I think I've got it all figured out, thanks all the help everyone! j/k!

The Aggregator module uses the theme_item_list function to output what you see when you add a an rss feed block to your page. You just need to over-ride this using a template.php file in your theme's directory. For instance, in mine I could use:

<?php
function weekly_davespeak_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = NULL) {
  $output = '<div class="item-list">';
//  if (isset($title)) {
//    $output .= '<h3>'. $title .'</h3>';
//  }

  if (!empty($items)) {
    $output .= "<$type" . drupal_attributes($attributes) . '>';
    foreach ($items as $item) {
      $attributes = array();
      $children = array();
      if (is_array($item)) {
        foreach ($item as $key => $value) {
          if ($key == 'data') {
            $data = $value;
          }
          elseif ($key == 'children') {
            $children = $value;
          }
          else {
            $attributes[$key] = $value;
          }
        }
      }
      else {
        $data = $item;
      }
      if (count($children) > 0) {
        $data .= theme_item_list($children, NULL, $type, $attributes); // Render nested list
      }
//Don't use those ugly bullet marks, instead wrap each line in a span.
      $output .= '<span class="rss_output">' . drupal_attributes($attributes) . ''. $data .'</span><br />';
    }
    $output .= "</$type>";
  }
  $output .= '</div>';
  return $output;
} 
?>

You can see: I've commented out the output of the title, and changed how the bullet items appear so that I can use my own css to change the way they look. Hopefully this helps someone else figure this out.

rob

Anonymous’s picture

and i can see no-one could help so looks like have to figure stuff out on my own too- what is the point of this "help" forum sometimes i DO wonder!

couldn't even get my feed to show in a block so just using feed link in navigation bar but have url: mypage and "never" updated, two messages I want to delete :/

Anonymous’s picture

my feed is now showing, i have no idea why but getting error with menu ...going to update 7.16 to 7.17 redo my subtheme the correct way and start from scratch.

vm’s picture

the reviving 6 year old threads which were are likely older than the version of drupal in use today doesn't tend to bring help. While the OP hid the offending element by commenting out code in a function override, one can also use css and display: none; on the h3 element of the block in question.

as far as your other issues with updating the feed, check your other threads (4 by my last count) where you've gone well out of your way to mention it.