A few months ago, I was working on a Drupal module where I wanted to display form that contained a list of checkboxes and images that would allow the user to choose the images that were to be displayed in a block. Surprisingly, it really wasn’t that difficult.
Category Archives: Drupal
Using Zend Framework with Drupal
Drupal, PHP, Zend FrameworkI have been using ExpressionEngine and Zend Framework on my current project. We recently migrated the cms to Drupal (see migration), but we wanted to keep the Zend Framework apps. Most of the content of the website is handled by Drupal 7 (link), but certain urls on the website are handled by Zend Framework. On the Zend pages, I removed all layout information so that it is controlled by the Drupal theme.
Migrating ExpressionEngine to Drupal 7
DrupalI’ve been using ExpressionEngine on a project for almost two years. Although the end-users of the company like ExpressionEngine, my boss has never liked it and has wanted to move to Drupal for quite some time. We finally go the chance with the start of a new project. I have created websites using Drupal 6, but that was quite a few years ago. Now I was tasked with migrating ExpressionEngine 1.68 to Drupal 7. The entire script can be found on GitHub. Although the script is specific to ExpressionEngine, the steps required for migration can be used to migrate any content management system to Drupal.
Drupal Install: Configuring Apache
DrupalI plan to create Drupal video tutorials in the near future. Although I use a Mac as my primary development box, I have Adobe Captivate installed on my Windows PC. So I installed Drupal on my PC and I ran into problems that required Apache configuration changes.
index of/
The Problem: When I clicked on the ‘Administer’ link on my site’s home page, ‘index of/‘ and a list of my site files and directories displayed instead of the administration page. In fact, any page that I attempted to go to resulted in this ‘index of/’ display.
The Solution: I opened the Apache configuration file (httpd.conf) and found that the Allowoverride for .htaccess files was set to None. I set Allowoverride to All and restarted Apache.
Clean URLs
The Problem: I always enable Clean URLs, but for some reason, I was unable to on my PC.
The Solution: I again opened my httpd.conf file and found that Apache’s mod_rewrite module was not enabled (this must be enabled in order to use Clean URLs). So I uncommented the line that loads the module and restarted Apache.
Now Drupal is running perfectly on my PC. I was a bit surprised that I had not configured Apache prior to this, but I guess that I use my Mac (and Ubuntu) so much that I never found the need. Enjoy.
Drupal, JQuery: Dropdown Menus
Ajax, Drupal, JQueryI needed to add Dropdown menus to a site that a designed using Drupal. I found a few modules (Nice Menus, etc) that would enable me to easily add dropdown menus to my site, but I wanted to use the CSS Drop-Down Menu Framework that I discussed in a previous post. With a little help from JQuery, I was able to add dropdown menus to my site without having to use a Drupal module.
Relative Image Paths in Drupal
DrupalI’m working on a project that uses Drupal and I wanted to add a few images to the home page.
First I created the folders files/images under the root directory. I then created the home page (Create Content->Page). When adding images to the home page, the file location is relative to the root directory:
<img src="files/images/flash1.jpg" width="168" height="112" class="imageFloatLeft"> |
But when I created another Drupal page (a page other than the home page), the relative path for the image is different:
<img src="../files/images/flash1.jpg" width="168" height="112" class="imageFloatLeft"> |
And when I created a page using Drupal’s Panels Module, the relative path for the image is once again relative to the root directory:
<img src="files/images/flash1.jpg" width="168" height="112" class="imageFloatLeft"> |
Adding content to Drupal seems to be fairly straightforward, but I did struggle a bit as I tried to figure out the relative paths of images/files so I hope this helps anyone else who may be struggling.
Learning Drupal – Step 1: Themes
Drupal, Pebblet, PHPI have been a PHP developer for many years and I have recently started learning Drupal 6. I struggled for a few days just trying to modify one of the existing themes. If any of you are just starting to learn Drupal and you want to create your own design/theme, I found that the easiest way is to first create your design template (HTML and CSS) without the PHP/Drupal code. Once your design is complete and can be viewed correctly in the modern browsers, then open up one the themes (page.tpl.php) that are installed with Drupal and copy/paste the revelant PHP code into your template. I also use this approach when I create WordPress themes.
Before you begin your design, make sure that you have a fairly good understanding of Drupal’s Regions, Blocks and Modules and Blocks (Blocks are placed into Regions). Namely, header, left side, right side, and footer. You don’t necessarily have to use all regions in your design (i.e., you may not need a right side), but you should have a good understanding of what each region can be used for.
When I created my first Drupal theme, I did not think that I needed a right side, so I did not create one. But after I looked at other websites that use Drupal (and the many contributed modules), I found some very good content ideas that can be placed on the right side of my Drupal theme template.
I will, from time-to-time, post other Drupal tidbits (as I learn them).

