I have a function that inserts a "tab" beside the "edit" tab in the user account section. This tab links to a calendar view which I am embedding through this function. Everything works great, except that when you click "week" or "day" view nothing happens. The forward/backwards link shows the right URL (user/1/journal?=journal%2F%2F2010-W25). But when clicked, the page refreshes and nothing happens... always stays on Month view.

Any help would be great, thanks all!

function journal_user_page($account)
 { 
 	 	
  	$view_name = "journal";
 	return "Enter Journal Entry Button<br><br>" . views_embed_view($view_name, 'calendar_1');
 }

Comments

ionut.alexuc’s picture

Try this:

$view = views_get_view('journal');
$view->set_display('calendar_1');
print $view->preview();

Ionut

alekm’s picture

Hey, thanks a lot for the reply!
While the view is embedded properly, the links still don't work. If I go directly to the view page (mywebsite.com/journal) all of the links work.

alekm’s picture

Not sure if this makes a diff. I'm adding the journal view into a TAB under the users profile.

function journal_menu() {
		
   $items = array();
   $items['user/%user/journal'] = array(
   'title' => 'Food Journal',
   'page callback' => 'journal_user_page',
   'page arguments' => array(1),
   'access callback' => 'journal_user_access',
   'access arguments' => array(1),
   'file' => 'journal.pages.inc',
   'type' => MENU_LOCAL_TASK,
   'weight' => -99,
);

return $items;
	}

Here is the function the renders the page:

 function journal_user_page($account)
 { 
 	 	
  	$view_name = "journal";
 	return "Enter Journal Entry Button<br><br>" . views_embed_view($view_name, "calendar_1");
 	
 }

I'm at a loss.