Hi,
I've created 3 page views as Tabs ('Provide Menu as Tab').
How can I place them, as tabs, in a panel?

Cheers,
Amitai

Comments

amitaibu’s picture

I've advanced a little.

if your panel url is path/to/panel, then make views url as path/to/panel/my_tab

My panel path = Style
My problem now is that I have $arg in my Views(e.g. Style/$arg/Main) - so when I click on the Tab i'm redirected out of the panels into the Views.

amitaibu’s picture

Component: User interface » Documentation
Assigned: Unassigned » amitaibu
Status: Active » Fixed

Found a solution (with help of Michelle in the IRC :)

First what I needed:
Panel path = Style
In panel several Views in tabs. The views should get an argument.

Style/3 - means the views should show relevant content according to NID=3.

so:

* Enable in JStools the Tabs module.
* Enter this snippet in Panels, or in a node:

<?php
  $form = array();
  $view1 = views_get_view('Style_View');
  $view2 = views_get_view('Style_Review');
  $view3 = views_get_view('front_users_recent');
  $view4 = views_get_view('front_events_upcoming');

  $form['recent'] = array(
    '#type' => 'tabset',
  );
  
  $form['recent']['tab1'] = array(
    '#type' => 'tabpage',
    '#title' => t('Main'),
    '#content' => views_build_view('embed', $view1, array(strval(arg(1))), false, false),
    
    
  );
  
  $form['recent']['tab2'] = array(
    '#type' => 'tabpage',
    '#title' => t('Review'),
    '#content' => views_build_view('embed', $view2, array(strval(arg(1))), false, false),
  );
  
    
  print tabs_render($form);

 ?>

Remember to:
1. change the name of the views on top - $view1 = views_get_view('Style_View');
2. the tab names - "#title' => t('Review'),"
3. arg(1) - means the first argument in the URL
4. enjoy
5. keep visiting the IRC...

Anonymous’s picture

Status: Fixed » Closed (fixed)
kompressaur’s picture

Hi i am trying to achieve this with the latest version of panels and ctools. I have finally worked out after 3 years how to make Views display in tabs. I have my frontpage here
http://spat.tv

the default panel tab is Frontpage and it has a path of /home. My 2nd view page is Recent Posts and it has a tab menu ad a path of /home/all.

when i click Recent Posts i lose the panel context. I cannot work out how to make Recent Posts to be in a panel. Will i be needing Panels tab style to do this?

thanks