You are here

Drupal & CSS

Using PHP to remove all nodes from a Content type

category: 

Today I had over 1,000 nodes to remove from a Drupal 6 installation. The bulk update only lets you remove 50 nodes at a time. What to do?

My Situation

All the node were from a certain content type. Actually, I need to remove all node that belonged to a particular content type. Lets call this content type "articles" My Solution Use PHP to remove all the node that belong to that node type. First I activated the PHP filter Then I ran this PHP script

How to create a menu using views and your theme in Drupal

category: 

Recently, I ran into kind of  a jam while working on a drupal project. I had a view pulling multiple elements of a node into a list. I was pulling things like the title, thumbnail and description. The thing was this list was suppose to act like a menu. What I needed was a views menu.

Bulk update comment settings on multiple nodes - Drupal

category: 

Recently, I needed to archive the blog section of a Drupal site. Part of this included removing all past comments and removing the ability to leave new comments. Removing comments is pretty easy in Drupal. There is a comment management section for that.

However, to remove the ability to comment on published nodes requires a bulk update. This is something that is not available in the standard Drupal site. Therefore, I had to resort to an alternative method of bulk updating the blog posts.

Use Jquery to add commas and remove non integers in Drupal Webform Module

category: 

Drupal's Webform module is top notch. I have made the move from Webform 2.x to Webform 3.x because of the usability and features. The only issue I have is the lack of a number field. Actually, both versions of Webform have this issue. If you want to format a textfield to restrict the character set to integers, the Webform module does not do this. However, I don't see this as a downfall. Webform is a very useful module. Besides,  we can easily limit characters in an input is pretty with Jquery.

My Problem

Showing sections of a page based on user role

category: 

I recently had a need to show parts of a page based on a users permision. After piecing some code to gether from different threads on the drupal site I came up with this.

Find out what the name is in the array

<?php print_r($user->roles); ?>

The actual code

<?php if (in_array('ROLE HERE',$user->roles)): ?>

<?php endif; ?>

 

 

<?php global $user; ?>

<?php if ($user->uid) : ?>

<?php print l("My stuff",'stuff/user/'.$user->uid); ?>

CSS3 Gradient Background Repeat Problem

category: 

I am a huge fan of using CSS3, and I love the gradient feature in CSS3. When you use the gradient feature on the <body> tag, a funny thing happens when you scroll down the page. The page seems to repeat the gradient as you scroll down.

This is because the gradient is actually a background image. Please observe the block of code I used for this gradient.

Drupal Changes their Design

category: 

Today I was in need of some information on an Ubercart module on Drupal.org. Following a link from the Ubercart site, I found the module I needed. However, I felt lost when I got to the site. I looked up at the url to ensure I was on drupal.org. Yes, I was.  The first thing that came into mind was, "this design is horrible. It is in no way user friendly."

Good thing I didn't create this post at that time.

On a second visit, I found some pretty useful stuff on the home page. Here is a quick list of things I find nice on the home page.

My top five menu modules

category: 

Recently, I was updating a Drupal site for a client. The criteria included some menu features that were not included in any of the menu modules I had previously installed. Having forgotten the module I used, I googled the specs. However, the results included a bunch of links to irrelevant pages/sites (Bing?). I then manually search through the Drupal contributed modules. In my search I found some pretty cool menu modules offered by the Drupal community. I have created a list of these below.

Pages