Drupal

Update and my projects

Mar 25, 2010

In January I started in a full-time position at Incite Marketing as a Web Developer. Incite is a local marketing firm with more than 10 years in the field and while my job involves working with a CMS, I had to switch to Expression Engine so I won't be doing much work in Drupal, hence you won't see me posting about it too often. The reason is because I'm spending my extra time working on my Android projects.

As I posted before, I started building an Android app for reading comics. It still doesn't have a name but so far it's working pretty well with reading manga from OneManga.com. Although, thats no the only way to get comics, I also plan on giving the ability to read from ZIP, RAR and CBR files.

Another one of my projects is my Drupal administration theme Cleanr. So far is doing well, with over 130 sites reporting they are using it.

I'm also getting a Nexus One in the next couple of days, so with having an HTC Magic and a Nexus One I will be making my Android apps to work better on both devices. I will be posting pictures of my phone soon. 

 

Cleanr Administration Theme

Nov 23, 2009

Last night I released the first version of Cleanr, a Drupal administration theme that tries to make the interface more simple and clean. This theme was mostly created for site maintainers, usually clients that don't know much about Drupal but need to work with it everyday. The main goal is to improve Drupal administration UX the most I can. Here are some screenshots of the first version of the theme:



_Administer page with an error message_


_Collapsible fieldsets_

Create your own node submission form

Nov 03, 2009

A lot of times you have to make the node/add page look just the way you want, and you usually start complaining that it's technically impossible with Drupal. There are a lot of techniques for this but I will be talking about one in particular which is creating your own little module that does the job.

Creating a module? Isn't that really hard?

Not really, it's simpler that it sounds and in this case it won't have more than 60 lines of code.

Our module will be called Apply, and it will basically show a form so users can apply for something. It will create a node based on a custom node type we will create.

  1. Go to sites/all/modules
  2. Create a folder called apply
  3. Create 2 files: apply.module and apply.info

Drupal modules list

Oct 29, 2009

This past monday I met a couple of Drupal developers and people who are actually interested in learning Drupal. The group was a nice mix of people sharing experiences and others trying to keep up and learn the most they can. It felt great, seeing what people expect from Drupal and what people have done with it, or what do they use Drupal for, but they all had one thing in common, it's always hard to find good modules or the one that you really need.

In Drupal you can take the same task in many different ways, the problem is when you get to the point where you realize that you should have chosen the other one. And here's an example.

So, this is my approach on reviewing some Drupal modules to let users know what kind of things you can do with them.

Let's start:

New blog, same content, now on Drupal

Oct 19, 2009

The old blog in Wordpress is now gone and I will be using Drupal from now on for my blog. The main reason of this is because I work with Drupal, it's also more flexible and overall I feel more comfortable working on it.

So far, besides the change on the platform there are not so many changes, but let's list them:

Design

Even cleaner, brighter and more attractive. I like to keep it simple, I love blue tones and my personal blog is the perfect excuse to use them.

The Work section also sports some nice selectors and some jQuery AJAX godness.

Plan, administrate and test your Drupal site

Oct 02, 2009
Drupal 6We all know Drupal has some usability problems (or a lot). It's not friendly when you first install it and adding modules and themes can be confusing at the beginning. But wait! Adding stuff to Drupal is so easy, just download the zip file upload to the server and enable the module/theme. And here is exactly when we start having problems. At one side, going module shopping is easy and repetitive fun but on the other side we often forget that downloading 20 extra modules can make our site run slow and even make it crash. Not to mention that some modules are not meant to be compatible with others. And first of all, don't be scared of buying a book that teaches you how to administrate Drupal, it's definitely worth if you are going to be in charge of the content.

Plan your site before start building it

Even though this is important for any kind of project, because of Drupal ease of installation and setup users tend to "try" modules and forget that little tab called "Uninstall". Even so, some modules won't completely uninstall or can just break other parts. Not all modules are perfectly made.

Visible Description on Drupal Primary Links

Jul 03, 2009

Today I was working on a new site when I realized that the top navigation had descriptions under the links. I asked myself for a few seconds, how can I do that on Drupal? If you don't know what I'm talking about, have a look at this screenshot of another site. digi I'm doing this on a theme, so no need for a module here. What I need to do here is override (the "Drupal way") the theme_links function and that's very easy on a theme, we just need to go to /includes/theme.inc and copy the theme_links() function. Then we can just paste it on our template.php file but we change the function name from theme_links to MYTHEMENAME_links.

Understanding the theme() function on Drupal

May 25, 2009

One of the most complicated things to understand when templating or developing modules for drupal is the theme() function. But when you know how to deal with it is really useful even when there's no way to know how many we have available. The way to use it fairly simple, let's see how the Garland theme builds the primary links:

print theme('links', $primary_links,
array('class' => 'links primary-links'));

The first argument is the actual hook we are calling, the second and third are the the arguments we are passing to that functions. So basically the theme function will output plain HTML and it's actually way cleaner than defining a function or coding a lot of php on our template.

Drupal and GIT

May 10, 2009

During this year I've been moving my projects to GIT. While my private projects are on this server, my public ones are on GitHub as Open Source. Git is a really wonderful version control tool for any kind of project. It makes it easy for me to deploy, maintain and update my current sites. I just wish there could be a way to include the database on it. In this post I will explain how I'm using GIT to manage a Drupal site on both local and live environment. And since most people already have a site working, I will explain starting from an existing site.

Create the repository

The very first thing is going to the actual site, in my server this site is in: /var/www/sitename.com/public

cd /var/www/sitename.com/public
git init
echo "sites/default/settings.php" >> .gitignore

You can also run this if you want to ignore the files folder (that's really up to you)

echo "sites/default/files" >> .gitignore

Then you have to add all files to the repository and make the first commit

git add .
git commit -m "Initial commit for this site"

.htaccess hotlink protection

Jan 16, 2009
Protecting your site from hotlinks can be really useful to prevent other sites stealing bandwidth, but it's also comes handy when you want to protect files from private areas. The first 2 lines are responsible from redirecting all the traffic from www.yoursite.com to yoursite.com and the third and fourth line is for preventing hotlinks, in this case PDFs and SVGs.