Archive for category Development

Code Search feature

drupaldeveloper.in is inviting suggestions for its search tool using which any one can search any codes within drupaldeveloper.in
Your suggestions will be hightly appreciated.

Read more: Code Search feature

Auto create blocks from nodes

This CodeLet creates Block for individual nodes. The CodeLet is very customized displaying only one field of the node but it can be altered to display any or all of the fields in the block.

Read more: Auto create blocks from nodes.

Themeing best practice

While developing a theme for Drupal, there are best practice one should always follow.
If you are deriving your theme from another theme/theme framework, make sure you name your theme in unique way, otherwise there can be conflicts in theme function names.

Read more: Themeing best practice

Theme Developers

Developing a theme in Drupal is quite a fun. It tests your knowledge and skills both in HTML/CSS and Drupal API. A Drupal Theme Developer, who is proficient both in HTML/CSS and Drupal API can create great themes. Developing Drupal themes is little bit time consuming and one has to test it with all the popular browsers and has to make it cross browser compatible.

Read more:  Theme Developers.

Automatic redirection to node translation form

This code will redirect you to the translation form of a node after you have created a node. Make sure you have selected a language and not “Language neutral” when saving the node.

Read: Automatic redirection to node translation form.

What do you prefer to develop a Drupal theme?

Poll: What do you prefer to develop a Drupal theme?.

Drupal hook: hook_link

hook_link lets us define links to be displayed on nodes and comments. These are the links wich makes it easy for the end user to access more information related to a node. Like adding comment, accessing the tags and sending feedback to node authors or site admin using
http://ly2.in/B]EGD_ module.

Read more: Drupal hook: hook_link.

Content types in tile with images

This CodeLet will create a tiled page with all the content type listed with individual image uploaded using the admin form. This CodeLets demonstrates user of different Drupal APIs like file_save_upload, hook_menu and hook_perm …

Read more: Content types in tile with images.

Drupal file upload: file_save_upload

Drupal’s file_save_upload function saves an uploaded file to a new location as specified in the parameter of the function.

Syntax:
Drupal 5: file_save_upload($source, $dest = FALSE, $replace = FILE_EXISTS_RENAME)
Drupal 6: file_save_upload($source, $validators = array(), $dest = FALSE, $replace = FILE_EXISTS_RENAME)
Drupal 7: file_save_upload($source, $validators = array(), $destination = FALSE, $replace = FILE_EXISTS_RENAME)

  • $source: This will be the field name using which the file is being uploaded.
  • $validators: This is an associative array of callback functions which validate the uploaded file. The function names are keys and and values of the array will be any arguments to be passed to the function callback…

Read more: Drupal file upload: file_save_upload.

Drupal hook: hook_user

Drupal offers user management out of the box. This includes new user registration, log in, password mailer and user session management. Drupal stores password as md5 hash value. When a user provides her log in credentials, Drupal generates md5 has values for the password provided and compares it with the one stored in the database against the provided username/email address. This is a well known technique implemented by Unix.

Though Drupal manages the users, we can still alter the behavior of different default actions on a user activity. For example, if you log in from the front page, by default, you will be redirected to front page. Instead we can make to redirect to different page or different front page, that can only be accessed by logged users. To achieve this, we need to use hook_user Drupal hook.

Read more  Drupal hook: hook_user.

Rss Feed Tweeter button Facebook button Technorati button Reddit button Myspace button Linkedin button Webonews button Delicious button Digg button Flickr button Stumbleupon button Newsvine button Youtube button