February 2010

Image menu

in Project codes

This CodeLet will allow you to add an image to a menu by overriding the menu in the template.php file of you theme. Also, the module offer admin side control to select and put the image to a menu item.

Node Visitors

in Project codes

This CodeLet adds a local task on node page which lists all the unique visitors of the node. You can configure the profile fields to be shown list.

Node information

in Project codes

This CodeLet shows a link on nodes to request more information for a node. By clicking the link, the user will be redirected to the site wide contact page and the subject field of the contact form is filled with the node title. Also, the link to the node will be added just before the mail will be sent. Thus preventing the user from modifying the link.

Grid of terms in a block

in Project codes

This CodeLet show how to display terms in a vocabulary as block. The CodeLet will display the terms, along with term icon, if taxonomy image module is installed, in a grid of 4X4. The block is configurable. You can select which vocabulary to show the terms from. Its quite attractive and can be used on front page.

Project codes

This CodeBook contains CodeLets from different projects that are allowed to publish to community. All the CodeLets under this CodeBook are published under GNU/GPL license. You can use, share, modify and publish it under GNU/GPL license.

CodeLets

  • Grid of terms in a block
    • This CodeLet show how to display terms in a vocabulary as block. The CodeLet will display the terms, along with term icon, if taxonomy image module is installed, in a grid of 4X4. The block is configurable. You can select which vocabulary to show the terms from. Its quite attractive and can be used on front page.
  • Node information
    • This CodeLet shows a link on nodes to request more information for a node. By clicking the link, the user will be redirected to the site wide contact page and the subject field of the contact form is filled with the node title. Also, the link to the node will be added just before the mail will be sent. Thus preventing the user from modifying the link.
  • Node Visitors
    • This CodeLet adds a local task on node page which lists all the unique visitors of the node. You can configure the profile fields to be shown list.
  • Image menu
    • This CodeLet will allow you to add an image to a menu by overriding the menu in the template.php file of you theme. Also, the module offer admin side control to select and put the image to a menu item.

Drupal hook: hook_view

The full view of a node including all the information associated with the nodes like author, node posted date, file attached to the node and any other data that are associated by other custom modules is managed by hook_view. The main goal and use of the hook_view is to allow the node modules to add extra information and manage those extra information to display when viewing the node. Nodes can have tease view as well as page view. On teaser view, only some of the information associated with the node is displayed; we can say its an overview of the node. On page view, all the information associated with the node is displayed.

<?php
/**
* Implementation of hook_view
* @param $node
* @param $teaser
* @param $page
* @return unknown_type
* @author Drupal Developer
*/

Drupal hook: hook_block

Blocks are the one of the basic and most fascinating features of Drupal. With block you can display information in the form of block by saving and utilizing the screen area. Here is an example of implementation of hook_block

<?php
/**
* Implementation of hook_block
*
* @param $op
* @param $delta
* @param $edit
* @return $block
* @author Drupal Developer
*/
function browse_info_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks[1] = array(
'info' => t("Browse information by category"),
'status' => 1,
'region' => 'content',
'weight' => 0,
);

return $blocks;
case 'configure':
$am__vocabulary = _get_vocabulary();
$am__imagecache = _get_imagecache();

Syndicate content

Recent comments

toolbar powered by www.mit3xxx.de