Hello, i was wondering if there will be (or there is) the possibility to show more than just the title in the recently read content block. I mean something like "customize" the output of the block so that it can show an image (if there is one) or other fields of the node.

Michele

Comments

pgorecki’s picture

I was thinking about integration of this module with Views. However, this will take some time to implement.

pgorecki’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.0-alpha4

Starting from alpha4, you can do it via by overriding theme_recently_read_item_list and theme_recently_read_item. For example:

function mytheme_recently_read_item($variables) {
  $item = $variables['item'];
  $node = node_load($item['nid']);
  if ($node->type=='article') {
    $image = field_view_field('node', $node, 'field_image');
  }
  return l($item['title'], 'node/' . $item['nid']) . render($image);
}

You can get more information about rendering Drupal 7 fields here: http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way

pgorecki’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

MakeOnlineShop’s picture

Hello,

Thank you for this code.

Do you know how I could easily add products photos of my Ubercart shop to the Recently read block ?

I cannot find any module doing this for Ubercart.

Thanks.