I have created some drupal views for civicrm. But the views pages are opening inside the drupal set up, where the civicrm toolbar is not showing. Now, how can i show the civi toolbar in the drupal? To avoid the switching between drupal and civicrm.
To answer your question, I wrote a module:
The code snippet I posted below probably wouldn't work because of timing issues (by the time the block was being printed it's too late to add the header). Seemed better to package it up into a module. Enjoy.
I don't think there's an easy way to do what you're describing. However, you CAN add a View to the CiviCRM dashboard, which may give you the same result with less effort: Check it out.
The following php code will do it. If you have the php filter enabled in drupal then you could place this in the header of the view, or in a block. Just make sure to only include this code on screens where the nav menu isn't already!
civicrm_initialize(); CRM_Core_Resources::singleton()->addCoreResources(); require_once 'CRM/Core/Smarty/plugins/function.crmNavigationMenu.php'; $params = array(); print smarty_function_crmNavigationMenu($params, $params);