coder1.com

  • home
  • drupal articles
  • contact
Home

Drupal

Printing or Rendering a Node Field or Profile2 Field in Drupal 7

Mike Milano — October 20, 2011 - 1:17pm

When overriding a node template or user profile, you should not be drilling down the field array and printing the output unless you have a very good reason to do so. i.e. (do not do this) print $node->field_zipcode['und']['0']['value'];

The Drupal 7 field api offers us the field_view_field() function to get a renderable array of the output for a field entity.

  • Drupal
  • Drupal 7
  • 4 comments
  • Read more

Colorbox: New Lightbox Module for Drupal 7

Mike Milano — April 10, 2011 - 10:53pm

I came across this module tonight since Lightbox2 wasn't updated to D7 yet.

It's pretty nice and I'm happy I ran into the problem that had me searching for new tools.

http://drupal.org/project/colorbox

  • Colorbox
  • Drupal
  • Drupal 7
  • Lightbox2
  • Add new comment

Code Newbie vBulletin 4 / Drupal 6 Integration Project

Mike Milano — June 2, 2010 - 7:58am

This past week I've been porting a custom article system I wrote for Code Newbie to Drupal. The forums remain in vBulletin and that is the master user system.

The tricky part here is that the Code Newbie user base is in vBulletin. Surprisingly enough it wasn't that difficult utilize Drupal's user_external_login_register(). function.

  • Drupal
  • vBulletin
  • 3 comments
  • Read more

Drupal 6 to 7, a first glimpse

Mike Milano — May 9, 2010 - 11:05pm

Today I finally started porting a module over to Drupal 7. I didn't read up in depth on the changes and just dove in and started learning based on the PHP errors and features that were not working.

I'm not going to go into anything too in depth here as there is good information out there already, but I took some notes and will point out some changes I had to make with the module I was working on.

Admin settings path

  • Drupal
  • Add new comment
  • Read more

Adding IDs to all Fieldsets

Mike Milano — February 5, 2010 - 11:42am

A themer on a project I was recently working on needed a lot of CSS IDs added to fieldsets throughout the site.

Fortunately, there's a theme_fieldset() function in includes/forms.inc

I was able to copy that function into the phptemplate.php file, obviously change theme_ to phptempalte_ in the function name, and then add logic that adds an ID based on the fieldset name if an id does not already exist.

Here's the code:

  1. /**
  2.  * Format a group of form items.
  3.  *
  4.  * @param $element
  5.  * An associative array containing the properties of the element.

  • Drupal
  • Fieldsets
  • Add new comment
  • Read more

Q-Views

Mike Milano — November 11, 2009 - 10:58pm

Q-Views is a module I came across while browsing through new modules on drupalmodules.com.

It's been a while since I've been so impressed with a module. This allows you to create views based of SQL. You allow it to analyze your SQL and it will populate a list of options for each field your query returns.

You can write module hooks to handle the query output on a per-field basis, or you can write the handler directly in the configuration.

  • Drupal
  • Q-Views
  • Views
  • Add new comment
  • Read more

Subscribe All Users to a Simplenews Newsletter

Mike Milano — April 29, 2009 - 10:51am

There's been a couple times where I've had to subscribe all users to a new newsletter.

I started out with a snippet I found which cleans up the subscriptions, but I lost the link or I would have referenced it here.

Here's the code that will subscribe all users to newsletter node id 16. Note I'm using mysql_insert_id() as a quick fix so you will need to use another method if you're not using mysql.

  1. $result = db_query("SELECT uid, mail FROM {users} WHERE uid>0");
  2.  
  3. while ($row = db_fetch_object($result)) {

  • Drupal
  • Newsletter
  • Simplenews
  • Subscribe
  • Add new comment
  • Read more

Disable TinyMCE in Node Body Based on Node Type

Mike Milano — December 5, 2008 - 12:11pm

There's been a few sites I've used WYSIWYG editors on recently where I've run into the issue of needing to disable it on certain text areas. TinyMCE supports this with a theme override just fine, however, it's not so simple when you have multiple text areas with the same name.

Take the node edit form. For every node type, the body uses the same name.

A practical example of when you would need to disable a WYSIWYG editor would be when filling a node body with previously designed HTML like when you design an HTML Newsletter.

  • Drupal
  • Newsletter
  • Nodes
  • Theme
  • TinyMCE
  • Add new comment
  • Read more

Drupal Search : Index All Fields of a CCK Node

Mike Milano — October 1, 2008 - 3:04am

The Drupal Search API is powerful and pretty intuitive, but finding details on how to do something as simple as enabling searching on fields other than title and body could be a little daunting.

It's actually quite a simple concept. Anything exposed to your node view will be indexed. You can easily accomplish this by editing your content type and setting the Display Fields setting to Plain Text.

  • CCK
  • Drupal
  • Nodes
  • Search
  • Add new comment
  • Read more

Drupal ParaChat Module

Mike Milano — September 9, 2008 - 4:04pm

Update: Drupal 7 port released

The ParaChat Drupal module embeds a ParaChat applet in your site and automatically logs in users with their Drupal username. There is access control so you can setup which roles you would like to be able to join the chat room. For added security, you can configure ParaChat to validate users from the ParaChat server before allowing them to join.

Parachat Applet

  • Drupal
  • Modules
  • Parachat
  • 1 comment
  • Read more
  • 1
  • 2
  • next ›
  • last »
Syndicate content

Poll

Have you used any NoSQL Databases?:

User login

  • Request new password

Navigation

  • Recent posts

  • home
  • drupal articles
  • contact