How to display sub menus (children) of primary links in Drupal

This page describes how to display sub menus (children) of primary links in Drupal.

Using Menu Block

  1. Download and install the Menu Block module.
  2. Create a new menu block.
  3. Set the value of "Starting level" to "2nd level (secondary)".


Step 1: Since we'll be using php codes in a block to display menu, the first thing to do is to enable the PHP Filter under modules.

Creating views programmatically in Views 2

To create a View via code with Views 2 in Drupal 6:

  1. Create the view using the View UI like you normally would
  2. Export it to get the code
  3. Replace the first line ($view = new view;) with this: $view = views_new_view();
  4. Then display it, execute it, embed it, or whatever you want (i.e. $view->execute_display('default', array())

Here is an example using a simple View that displays the Title field of all Published nodes:

//create a new view
$view = views_new_view();
//define the view (this code was generated by the Export)
$view->name = 'test_date_view';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => 'Title',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,

Publishing to Facebook Wall

This page was originally written for the 2.x branch of Drupal for Facebook. You're probably using the 3.x branch (or later). The 3.x branch includes a file, modules/fb/contrib/fb_example.module, with code showing the updated API for fb_stream_publish_dialog(). Some of the information that follows is out of date.

Facebook provides a Stream API for publishing content to "streams". These streams include user and page Walls, and also allows you update a user's status. Read Facebook's documentation to get a sense of everything that's possible using these APIs.

Drupal for Facebook includes a module, fb_stream.module, to simplify publishing to Facebook Streams.


The fb_stream_publish_dialog() function presents the user with a dialog box. This form allows them to make edits to the content before it is published to their wall, or to skip publishing entirely.

CKEditor module: deeply integrated text editor

The CKEditor module is included in Drupal 8 core.

It is inspired by the Drupal 7 Wysiwyg module, and is the spiritual successor to the Drupal 7 CKEditor module. Think of it as the best of both, and then much better still!

How to redirect users after login in drupal?

For Drupal 7:

There are many ways to do this, either by using modules included in Drupal Core; or using any number of different contributed modules; or by building a custom module implementing the Drupal API. "Your mileage may vary" with each. Be warned, the login block sometimes behaves differently than the login page. Also, make sure you test the password reset path which can be affected.

Using Drupal core site-building

With Actions & Triggers

Similar to the steps below in the 'For Drupal 6' section, you'll first need to define the URL redirect action at admin/config/system/actions.

Then, after making sure the core module Trigger is enabled at /admin/modules (or using Drush), assign the URL redirect action you just defined to the "After a user has logged in" trigger at /admin/structure/trigger/user.

Ubercart Gestpay uc_gestpay

Module Still in development, please report bug.

Module Ubercart Gestpay payment gateway

Ubercart Gestpay lets you add a new payment type in the Store configuration for the BancaSella Merchant.
This module is really helpful for the Italian e-commerce provider as BancaSella is the biggest bank online merchant.


Subscribe with RSS Subscribe to RSS - Programmers