Project:Daily
Version:6.x-1.1
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

Ok I've been struggling with how to accomplish this using views so I finally resorted to a feature request. Maybe someone can point me in a direction I'm not seeing.

What I want is a block that will show the teaser of the daily content.

For my purposes what I am trying to do is to embed a daily content into a widget using the embed widgets module. Since the content in my daily content is a video this makes for a pretty big widget.

I've tried playing around with views to create a block but of course all I end up with is a block that shows the teaser of the container itself, not the content that is displayed daily.

I hope I'm making sense here.

So anyway my thinking is that if the daily module also put out a block showing the teaser of the daily content then things such as this could be accomplished.

Or maybe there's a way that I am not seeing.

Thanks for any input.

Phil

Comments

#1

Status:active» needs review

You could try this (untested) code (adding it to daily.module):

<?php
function daily_block($op = 'list', $delta = 0, $edit = array()) {
switch (
$op) {
   case
'list':
    
$blocks[0]['info'] = t('Daily content');
     return
$blocks;
   case
'view':
    
$tid = 34; // enter the tid of your daily vocabulary here
    
$nr = 0; /* Use -1 for the last item, -2 for the last-but-one item, etc; use 1 for the first item, 2 for the second item, etc; use 0 for a random item refreshed once a day */
    
$daily_node = _daily_node_by_tid($tid, $nr);
     if(
is_object($daily_node)) { $daily_node = node_view(_daily_node_by_tid($tid, $nr), $teaser, FALSE); }
    
$block['subject'] = t('Daily content');
    
$block['content'] = $daily_node;
     return
$block;
  }
}
?>

#2

I'll give it a shot and report back soon

Phil

#3

This works great if you have only one daily container. We have several such as tip of day, joke of the day, etc.
Blocks for each daily container is greatly needed. It takes up way to much room at the top of the frontpage to have all of these "Daily's" set as Promoted to frontpage, sticky at top. Any solutions would be greatly appreciated.

#4

Status:needs review» closed (won't fix)

Take a look at the node-as-block module: http://drupal.org/project/nodeasblock.
It seems to do exactly what you are asking for.
If you want to remove the first/previous/next/last links or the calendar, you can always use CSS and set display:none.

Note that documentation for this module is a bit sparse: the trick is to edit the node you want to turn into a block.