I'm creating popular content blocks for my multi-user blog website using views. By cloning the default "popular" view and making some edits, I'm able to display both the "Popular content" block and the the "Today's popular content" block for the site's blog content.

I'm wondering how I can combine the content of the "Popular content" block and the content of the "Today's popular content" block into one block, which will be similar in presentation to the "Popular content" block provided by the Drupal Statistics module.

Many thanks in advance.

Comments

merlinofchaos’s picture

Status: Active » Fixed

You could probably use an attachment display for one and of the two queries and attach it to the block display.

hazart’s picture

Thanks a lot, merlinofchaos. I actually used the following PHP code as the Header of the "Popular (block)" display:

<h4>Today's:</h4>
<?php

$block = module_invoke('views', 'block', 'view', 'popular_global-block_1');
print $block['content'];

?>
<br />
<h4>All time:</h4>

where 'popular_global-block_1' refers to the "Today (block)" display.

It worked flawlessly. Thanks again for all your work on this amazing module!

Status: Fixed » Closed (fixed)

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

michaelcrm’s picture

to merlinofchaos:

Your suggestion is very helpful! Thank you.