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.

Comments

jhedstrom’s picture

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:

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.