Tag Archives: Views

Drupal – Customize Node Template with Panel

Panels is a very useful module for customizing page layout. You can either create you own page or edit the Drupal default templates such as Node View and Taxonomy View. Download the Panels and Chaos Tool Suite and enable the following options. Continue reading Drupal – Customize Node Template with Panel

Drupal – Get URL Arguments in Custom module or Views Template

You can get the URL arguments in custom module or views template files. Create a custom module and use the hook_nodeapi to print the URL arguments.

 * Implementation of hook_nodeapi()
function custom_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'view':
      print arg(0);
      print "<br/>";
      print arg(1);

Continue reading Drupal – Get URL Arguments in Custom module or Views Template

Drupal – Customize the Views Query

I want to create a taxonomy view which shows the term name and the term image. For those terms without term image, i want to filter out them. Unfortunately there is no term image filter in the view setting. One work around is overriding the view query by implementing the hook_views_pre_execute(&$view) in a custom module. Before you construct the new SQL, you should set all your desire settings in the view editing page first. Then you can create a new SQL base on that view query.

So in the custom module, add the following function. Continue reading Drupal – Customize the Views Query

Drupal – Build an Online Store with Ubercart

The Ubercart module is a complete E-Commerce suite which turn your Drupal website into an online store. It is a very big module which contains a lot of features. In this article, i will try to show you those basics but actually i am not intimate with it very well.

Before you start, it is recommended that Imagecache, CCK Image field and Views are installed. This allows our store product image showing to the customers.

1. Download and install the Ubercart – core features. Continue reading Drupal – Build an Online Store with Ubercart

Drupal – Using Node Reference in View

Sometimes we may want to create mapping in content types. Say, i created an Artist and a Song content types. when i select an artist, i want it to select all the songs which belongs to that artist also. In that case, we need a node reference field in the Artist content type such that every song is mapped to an artist.

So first, create the Song content type with default fields. Then create some songs and fill in the lyrics as node body. Continue reading Drupal – Using Node Reference in View

Drupal – Add Image for Taxonomy

Taxonomy allows you to add Categories and Tags to node. Previously i have created some terms/tags for the Stories vocabulary/category.
Drupal – Manage Categories and Tags by Taxonomy

So now i want to add an image for each of the terms under the Stories. So what you need is a Drupal module called Taxonomy Image.

Enable the Taxonomy Image in Drupal. Continue reading Drupal – Add Image for Taxonomy

Drupal – Image and Image Gallery

The Image module allows you to add new node with a new content type called Image. The uploaded image could be viewed in original size, thumbnail size and previews size. This can be configure @ Administer –> Site configuration –> Images.

I would like to share two more features in this module.

  • Image Attached – Allow you to add images in other content types
  • Image Gallery – Group the Image nodes into Image Gallery by Taxonomy (include Views support if you have Views 6.x-2.6 or later)

After you have enabled the Image Attached features in your Drupal. you can now allow image upload in content types. Just go to a particular content type edit page and you will find the Image Attached settings. Continue reading Drupal – Image and Image Gallery

Drupal – Create a Customized View

You can create you own customized view in Drupal with the help of the Drupal Views module. The Views module not only help you creating your own designed Pages but also the customized Blocks, Feed and Attachments. The following example shows you how to make use of the Views module to create a table view for all the Listed Item content type which i created a few days ago. You can refer to the following posts about for creating new content type.


Here comes the Views module. Continue reading Drupal – Create a Customized View