Sunday 14 October 2012

How to open pages or content node in Drupal 7 overlay.

hello all,

To open normal page or node in Drupal 7 overlay format.
You need to two things
1) add Overlay permissions to all user
2) create custom module.
    Create custom module custom_overlay.info file  and custom_overlay.module file. In custom_overlay.module file we are going to add code under hook_admin_paths_alter function.

In that function we assign TRUE value (i.e 1) to paths variable to open in  overlay format.
e.g. :-
$paths[PATH_TO_NODE] =1;
$paths[PATH_TO_PAGE] =1;

//Add below code in custom_overlay.module
/*
 * HOOK_admin_paths_alter
 */
function custom_overlay_admin_paths_alter(&$paths) {

 $paths['node/*'] = 1; // For all node
  $paths['node/2'] = 1; // For specific node
  $paths['user/*'] = 1; //all user page
  $paths['contact'] = 1; // For Contact page
  $paths['content/*'] = 1; // ALL node or page under content

}


Add Google web font externally in DRUPAL 7




Find the template.php in your custom theme folder edit the template.php and add this function

function mytheme_preprocess_html(&$variables) {
drupal_add_css('http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic&subset=latin,cyrillic', array('type' => 'external'));
}

NOTE:
 change the mytheme with your theme name!.

For more Check this Out...
http://blog.morethanthemes.com/post/9951799439/drupal-7-tutorial-adding-google-web-fonts-as-external