Php arguments in Views for Drupal can be the answer you need to getting your views to output correctly. Follow along as I go through a handful of very useful php arguments for Views.

I don't claim to fully understand Php and php arguments. I'm still learning, but what I do know I'm glad to share with those willing to listen.

I use php arguments mostly to get a view block to only show up on certain dynamic url pages. The first time I really used this technique was in one of my previous posts: Related Content with Views 2 in Drupal

Here are a few others with some explanations:

Similar Node Title:

if (arg(0) == 'node' && is_numeric(arg(1))) {
  $node = node_load(arg(1));
  return $node->title;
} else {
  return FALSE;
}

To use CCK Field Argument:

if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
...Read more

Making a custom module in Drupal can be as easy or difficult as you would like it to be. For the purpose of the post we will be making a simple module in Drupal that you can use to alter forms.

Step 1
Make an info file for your module call it mymodule.info and rename the "mymodule" to whatever you will be calling your module.
In the info file you can put various items, but the only thing you will need is the following:

Drupal 5.x

// mymodule.info
name = "mymodule"
package = "My Modules"
description = "Put Description Here"

Drupal 6.x

name = My Module
description = "Put Description Here"
core = 6.x

If you plan on publishing this module you can put additional information in the file.

Step 2
Make a module file called mymodule.module and once again rename "mymodule" to your module name.
This module is going to be to alter forms so we will put the following code in.

Drupal 5.x
...Read more

Show related or similar content in a block with Views 2 in Drupal. Here is a step by step tutorial on how to accomplish this.

I first found this method over at Drupal Easy: Using Views 2 and Drupal 6 to Create a Related Pages Block. I'm going to show you a similar method with a few minor adjustments.

As of this writing this is accomplished with Views 2 and Drupal 6. ...Read more

  • Make a new view and call it whatever you want.
  • Add a Block Display
  • Add a new argument - Taxonomy: Term ID
    • Set up the argument with these options:
    • Provide Default Argument
    • Php Code:
    • $node=node_load(arg(1));
      if($node){
      foreach($node->taxonomy as $term){$terms[]=$term->tid;}
      return implode('+',$terms);
      }else {return;}
    • Check Allow Multiple Terms per Argument

Including an image with your RSS feed just got a whole lot easier. By using these easy steps you'll be on your way to stepping up your RSS feed.

Things you will need:

The Setup:
Follow the instructions for each module on how to install each one. ...Read more

Use simple e-mailing aliasing to speed up your work flow while testing user registrations.

GMail Aliases for Testing Multiple Drupal User Registrations was a recent article I read that change my work flow with testing Drupal user registration. E-mail Aliasing as defined by Gmail: Using an address alias.

I use a slightly different technique than the one in the mentioned articles. Both technique can be used with any CMS including Wordpress and Joomla.

The Basics:

Your e-mail address is example@domain.com, you simply add a dot or period anywhere in your e-mail name. Example: e.xample@domain.com or exampl.e@domain.com. ...Read more

A few days ago I saw a tweet from Rob Feature saying that he had posted over at Geeks & God that they had just launched a new website called Free Mission Websites.com.

After reading the post I headed over to Free Mission Websites.com to see what it was all about. In a nutshell its a site that is dedicated to making free websites for missionaries who are out in the field. Anybody who wants to contribute just has to sign up and start helping.

Drupal is going to be used for the sites for many reasons:

  1. Once a template install is figured out, it will be fairly easy to drop into new site configurations.
  2. Most of the people working with the project are already experienced with Drupal so time is minimized.
...Read more

Theming a Drupal User Profile is actually much easier than you think. Follow these few simple steps and you will be on your way to a fully customized user profile for your Drupal site.

This article assumes that you know how to theme a node, if not, first read Theming a node in Drupal...The Easy Way.

There are two main ways to get custom field into the user profile, content profile or using the core user profile that ships with Drupal. If you just want simple fields the core module is the way to go. For the sake of this article I will be using the core user profile module.

Using 6.x go to http://www.yoursite.com/admin/user/profile, there you can set up a couple of fields to your liking. ...Read more

Have you ever wanted to know what people are doing with Drupal in real-time and where they are? Well now you can with NowPublic.com.

I first stumbled across this on SocialMedia.biz. I was so impressed that I thought I'd share it with you.

NowPublic.com uses aggregation from several sites like Twitter and identi.ca, then allows you to scan them in real time.

What sets NowPublic apart from following most Twitter apps is the integration of a world map. So you can not only see what people are doing, but where as well.

Bookmark Drupal-scan to stay in the loop of what's going on in the Drupal world.

Want more traffic to your Drupal blog? Here are some very useful modules to get your site moving up the ranks of search engines.

This blog assumes that you have already read Increasing Traffic to your Blog Site, which is helpful for any general blog. This gets specific to what Drupal can do for your blog if you have a Drupal site already.

  1. Path: This is a core module and only needs to be enabled. Path allows URL aliasing, this provides clean URLs for your content to be found easier.


  2. Pathauto: This module expands upon the Path Module and adds automatic URL aliasing. This can be based on node type in conjunction with Tokens.


  3. ...Read more

I have often been accused of being lazy for using Drupal for the basis of my sites. Or have been asked if Drupal hinders my ability to make websites. To both I would say, you have underestimated Drupal.

Drupal is a tool, a tool for simplifying, enhancing, and promoting new creative websites. By using Drupal as my core for my websites, it free's me up and allows me to concentrate on the design. I also allows me confidence to know that it is thoroughly tested and very secure. I don't have to worry about a developer not turning in his projects in on time and making my reputation suffer because of it.

Drupal is not only helpful, it is reliable. I know that when I start a Drupal site, I can say with confidence to my clients, that the project will be complete and done on time. Time and time again, Drupal has proven itself to me through the use of complex modules and slick integration. ...Read more