PHP

Posted by ejhildreth

Lullabot developer Addi Berry put together some great screencasts on how to setup local Drupal test environments on Windows, Mac, and Ubuntu. Even though I have been running Kubuntu as my primary OS at home for over a month now, I hadn't actually set up my test server yet! To make sure I didn't make a misstep, I used Addi's video as the basis for the setup I did on my machine, but command lineified it a bit:

  1. Open Konsole
  2. Login as root
    • sudo -s
  3. Make sure that the repository is up to date
    • apt-get update
  4. Install Apache, MySQL, PHP5, the PHP5 GD Library, and the PHP5 MySQL configuration
    • apt-get install apache2 mysql-client mysql-server php5 php5-gd php5-mysql
  5. Enable Clean URLs in the conf file
    • vi /etc/apache2/sites-enabled/000-default
    • press i to go into insert mode
    • Change AllowOverride None to AllowOverride All in the <Directory /var/www/> section
    • press esc
Continue reading...
Posted by ejhildreth

In my role as a web designer at the Idaho Commission for Libraries, I design Drupal themes for our e-Branch in a Box project. On my most recent theme, I wanted to use a gradient background with rounded corners for the block titles. Since we run a multi-site setup, I was a little bit apprehensive to use a jquery solution and ended up using a background image instead. The problem with this technique is that when the block titles are too long, it would wrap around and not align in the image correctly. Since this was a theme for sites that I do not do the day to day maintenance for, I needed a way to catch the titles (the unknown) before they were printed out to the screen and shrink them up a bit. Template.php to the rescue!

Since all blocks are themeable, I went to the Drupal API and looked up the theme_block function. Next, I copied and pasted the function into my Template.php file and made the following modifications:

Continue reading...