How to embed views in magic_tabs using views2

txcrew - February 12, 2009 - 15:31
Project:Magic Tabs
Version:6.x-1.0
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Greetings,

I am aware of how to embed using Views 1.x but during the upgrade process to D6 I have to upgrade my magic_tabs layout as well.

I tried using the code:

<?php
function magic_tabs_mytabsname_callback($active = 0) {
   
$view = views_get_view('myviewname');

 
$tabs[] = array(
   
'title' => t('Active'),
   
'content' => print $view->execute_display('default', '3'),
  );
 
$tabs[] = array(
   
'title' => t('Upcoming'),
   
'content' => 'some more content',
  );
  return
$tabs;
}
?>

Which should return all items in taxonomy tid 3. It does, but it seems to display the results outside of the tabs or will display weather or not the tabs is selected.

Any ideas on the direction to go would be very helpful.

TIA, txcrew

#1

txcrew - February 12, 2009 - 15:34
Title:How to embed using views2» How to embed views in magic_tabs using views2
Status:active» fixed

Sorry for the premature post, I seemed to have figured it out:

Changing this line

<?php
    
'content' => print $view->execute_display('default', '3'),
?>

to this
<?php
    
'content' => $view->execute_display('default', '3'),
?>

produced the desired results.

txcrew

#2

System Message - February 26, 2009 - 15:40
Status:fixed» closed

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

#3

tommytom - May 10, 2009 - 17:07

I would like to insert a view also. Where do you enter the view name ?

#4

tommytom - May 10, 2009 - 17:07
Status:closed» active

#5

tommytom - May 10, 2009 - 17:08

$view = views_get_view('myviewname'); Now I see

#6

yhager - May 10, 2009 - 19:51
Status:active» closed

Enjoy :)

#7

tommytom - May 11, 2009 - 22:13

but how it's possible to pass arguments to the view ?

 
 

Drupal is a registered trademark of Dries Buytaert.