Posts

Showing posts from April, 2011

To Hide "Log Message" or "Revision information" from node form in drupal

To Hide "Log Message" manually , use the below code in template.php function phptemplate_node_form ( $form ) {   // Remove 'Log message' text area    $form [ 'log' ][ '#access' ] = FALSE ;   return drupal_render ( $form ); } OR  use the below module http://drupal.org/project/removelogmessage

How to get the views datas inside coding in drupal

To get the view datas inside coding , Use the below coding    $display = 'page_1'; // 'page_2' or 'block_1' etc $view = views_get_view('view_name'); $vars['photos'] = $view->preview($display, arg ); $vars['photo_count'] = $view->total_rows; Note: arg should be array arg should he replaced by array($vars['row']->nid) if used template.php file templatename_preprocess_views_view_fields(&$vars) { }

How to retrieve drupal views content using PHP Code

use the following php code for retrieve drupal 6 views content: $display = 'page_1'; // 'page_2' or 'block_1' etc $view = views_get_view('view_name'); $display = $view->execute_display('block_1', $myArg); print $display['content']; ?>

How to Fetch Profile field Values in drupal

We can add additional fields in the user registration form using profile module. The following code is used to fetch these profile field values anywhere in drupal. <?php global $user; profile_load_profile ( $user ); print( $user -> profile_ [ fieldnam e ]); ?>

how to get drupal block contents(using coding)

We can display any Drupal block anywhere in the website using the code given below. <?php $block = module_invoke( [module name], 'block', 'view', [block id] ); print $block['content']; ?>  

CSS for mac

To write separate CSS for mac os ,Copy the below script into the head tag of your page <script type="text/javascript"> var csstype="inline" //Specify type of CSS to use. "Inline" or "external" var mac_css='body{font-size: 14pt; }' //if "inline", specify mac css here var pc_css='body{font-size: 12pt; }' //if "inline", specify PC/default css here var mac_externalcss='/style/macstyle.css' //if "external", specify Mac css file here var pc_externalcss='/style/pcstyle.css'   //if "external", specify PC/default css file here ///////No need to edit beyond here//////////// var mactest=navigator.userAgent.indexOf("Mac")!=-1 if (csstype=="inline"){ document.write('<style type="text/css">') if (mactest) document.write(mac_css) else document.write(pc_css) document.write('</style>') } else if (csstype==...

Text shadow in IE browser(css hack for text-shadow )

text-shadow: 0.01em 0.03em #000000; (For Firefix std browsers) filter: Shadow(Color=#000000,Direction=135,Strength=2);(For IE std browsers) -moz-text-shadow: 0 0 2px #000; (For lower level mozilla) -webkit-text-shadow: 0 0 2px #000;(For safari of lower version)