Nifty block...?

asak - January 10, 2009 - 15:24
Project:Session Favorites
Version:5.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

The demo site shows a cool block at the header, which updates according to the number of flagged items.

Would be nice to have this block as defaultv (or im a just missing it?) .

For now, is there a simple php block which i could create for the same effect?

Thanks.

#1

jhedstrom - January 12, 2009 - 17:35

Hey asak,

Unfortunately, on that sight, the header functionality was added in at the last moment, via the theme layer instead of the preferred block method. I think a block would definitely be the way to go.

In the mean time though, this is the code used in template.php to define a new variable for page.tpl.php:

<?php
if (module_exists('session_favorites') && session_favorites_available()) {
   
// Can't Miss functionality
   
$favs = count(session_favorites_get_list());
   
$vars['cant_miss_list'] = l(t('My Can\'t-Miss List'),variable_get('session_favorites_path', 'session-favorites')) . t(' (@items added)', array('@items' => $favs . ' ' . format_plural($favs, 'item', 'items')));
  }
?>

If, in the process of using this, you get a block into the module, I would gladly apply the patch.

 
 

Drupal is a registered trademark of Dries Buytaert.