Showing posts with label Drupal 6. Show all posts
Showing posts with label Drupal 6. Show all posts

Tuesday, December 18, 2012

Drupal Login and registration links in popup.

We have number of modules to replace default login and registration features in drupal. sometimes we need this functionality in popup, and look for drupal modules. Same thing happen to me i looked in Drupal modules index page http://drupal.org/project/modules/index, finally i found the Ajax Login/Register.

This module provides a smooth way for the user to login, register and request new password via AJAX at any Drupal site.

Features:

  • This module provides a block with 2 links (Login, Register) for the anonymous user.
  • When the user clicks on Login or register the requested form appears in a nice ajax popup.
  • The login and register forms can validate using ajax and not redirect on error.
  • On success the module redirects to the user page.
  • When user is logged in, the block provides a Welcome !username message and a link to the user page and a logout link.
  • This module integrates the thickbox plugin with the Ajax module and provides a simple, easy to use and cool login and register block.
Here is the Demo

Tuesday, January 31, 2012

Structure of the .info file in drupal theme


Contents

Drupal understands the keys listed below. Drupal will use default values for the optional keys not present in the .info file. See the examples set for core themes.
  • name required
    • name = A fantasy name
  • description recommended
    • description = Tableless multi-column theme designed for blogs.
  • screenshot
    • screenshot = screenshot.png
  • version discouraged
    • version = 2.0
  • core required
    • core = 6.x
  • engine required in most cases
    • engine = phptemplate
  • base theme
    • base theme = your theme name
  • regions
    • regions[left] = Left sidebar
    • regions[right] = Right sidebar
    • regions[content] = Content
    • regions[header] = Header
    • regions[footer] = Footer
  • Drupal 7 default regions:
    regions[header] = Header
    regions[highlighted] = Highlighted
    regions[help] = Help
    regions[content] = Content
    regions[sidebar_first] = Left sidebar
    regions[sidebar_second] = Right sidebar
    regions[footer] = Footer
  • features
    • features[] = logo
      features[] = name
      features[] = slogan
      features[] = mission
      features[] = node_user_picture
      features[] = comment_user_picture
      features[] = search
      features[] = favicon
      ; These last two disabled by redefining the
      ; above defaults with only the needed features.
      ; features[] = primary_links
      ; features[] = secondary_links

    • Drupal 7 features
      features[] = logo
      features[] = name
      features[] = slogan
      features[] = node_user_picture
      features[] = comment_user_picture
      features[] = favicon
      features[] = main_menu
      features[] = secondary_menu
         
    •    
  • stylesheets
    • stylesheets[all][] = theStyle.css
  • scripts
    • scripts[] = myscript.js
  • php

Tuesday, September 20, 2011

Create region in node.tpl.php (drupal 6)


1.Add code in yourtheme.info

regions[region_name] =  Region Name


2.Add funciton in template.php


function THEME_NAME_preprocess_node(&$variables, $hook) {
  $variables['
region_name'] = theme('blocks', 'region_name');
}



3.Add code in node.tpl.php



<?php if ($region_name) { ?><div class="region_name"><?php print $region_name?></div><?php }; ?>