Dear Yuval,
Thank you for your positive opinion for our website and for the the link. I agree that tabs implementation on our site is not best one, and probably will switch to the module that you've created.
But is it possible to display views with your module? The example in README file shows the content for the magic_tabs generated through:
'content' => t('Content of first magic tab')
How can we modify this line so that it could generate a view (for instance: $block = module_invoke('views', 'block', 'view', front_tasks_help); $tab=$block['content'];) on the fly?
Comments
Comment #1
yhager commentedYou just theme the view and put it in the 'content' key:
Comment #2
yngens commentedhi,
can you tell how to call view's block instead of view itself?
thanks!
Comment #3
chadchandler commented@ yngens,
Just duplicate the view, and uncheck "provide" page. Then it will call the block, or check out this module.
http://drupal.org/project/panels_tabs
Comment #4
chadchandler commentedEdited to add:
What would be the correct snippit to print a custom block?
Example:
Comment #5
yngens commentedThanks Prodigy. I knew of that method. But probably there is a way to call view's block (preserving page view itself too) directly via theme function, isn't there?
Comment #6
yhager commented@yngens: In that case you can use:
@Prodigy: there's no easy way to do that. I'll add the required code to the module.
Comment #7
chadchandler commentedI was just trying a bunch of different ways I thought would work, but they wouldn't.
I try to avoid views whenever I can just do the SQL myself for a block, so if this could be patched in , or if it is already possible calling in custom blocks would be uber fantastic.
Comment #8
yhager commentedI'll add easier way to do this with all kinds of blocks, not just custom, but for the meantime you can use:
(assign your own block id to $bid)
Comment #9
chadchandler commentedGreat! Thanks and I will test this first thing in the morning. This seems easy enough. I'll report back.
Comment #10
yngens commentedProdigy, may I ask why do you do that? Obviously, to gain some performance? But is the difference so much? Does it worth it?
I am asking this because if it really worth it, I also would like to switch making direct MySQL calls instead of using views.
Comment #11
yngens commentedthanks, yhager, for #6. works great!
another question - is it possible to suppress displaying pager in a block? in my views settings for the block there is no pager used, nevertheless magic-tabs displays my block with the pager.
Comment #12
yhager commented@yngens: I'm happy to help, but these are all generic views issues, unrelated to magic tabs.
If you want to display a limited amount of items in your block and no pager, use values instead of the 'NULL, NULL' we wrote above.
Consult the documentation at http://api.freestylesystems.co.uk/api/function/theme_view/5 (or in your views.module local install - search for theme_view())
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13.0
alex_shapka commentedDeleted the direct link to my website