latest articles

Limiting Node Title Lengths In Drupal

December 12th, 2008

Im just wrapping up development on WinForAYear.com and because of how I’ve formatted the nodes, I needed a way to shorten the titles if they exceeded a set length.  This feature would come in handy in many situations, like presenting a table of stats where the title could easily overlap into another column.

Now you could easily edit the title css to include a set width with “overflow:hidden” hiding the excess, but then you would be left with abruptly ending titles with no indication that there is more.  However, if there were “…” attatched to the end of the shortened titles, things would be more clear.

The Solution
Open up your node.tpl.php file in your drupal theme.  Look for this line:

<?php print $title; ?>

and replace it with:

<?php
// if title is longer than 28 characters, cut off the rest and add “…”
if(strlen($title) > 28){ print substr($title, 0, 28).”…”;}
else { print $title; }
?>

The Breakdown

if(strlen($title) > 28)

If the title is greater than 28 characters (including spaces).

{print substr($title, 0, 28).”…”;}

Display the first 28 characters of the node title and attatch “…” to the end.

else { print $title; }

Now we don’t want “…” being displayed if the title isn’t too long, so here we just display the title unchanged.

Share/Save/Bookmark

New Regions Not Loading in Drupal 6

October 28th, 2008

Creating new regions in a Drupal theme that you can publish blocks too, is extremely easy.

edit your “themename.info” file:

regions[name_of_new_region] = name of new region

then output the region in your “page.tpl.php” file:

<?php if ($name_of_new_region) print $name_of_new_region; ?>

The problem  you may run into (and the point of this post), is that during development of your theme, the new regions may not show up in your Drupal blocks page.  What you will need to do, is head over to your “build/themes” page and set another theme as your default temporarily.  Once another theme is saved as the default, reselect your theme and set it as the default once again.  This will load your new regions, and you should now be able to publish blocks to them.

I didn’t see mention of this problem on other sites, so I thought I would throw it out there in case anyone else had the same frustration!

Share/Save/Bookmark

Droppy | Nested Drop Down Menus with jQuery

October 23rd, 2008

Recently while working on VictoriasCreativeDesigns.com for an interior designer here in Vegas, I needed to create an elegant yet simple drop down menu for the main navigation.  The menu I had created was utilizing jQuery for a very “flash-like” effect, so I wanted to find a jQuery solution for the dropdown effect.

I stumbled upon Droppy after a few google searches.  It was fast to implemet and yet still looked great without too many tweaks.  If your looking for a good jQuery drop down menu, take a look at Droppy and take it for a spin.

Share/Save/Bookmark

Free High Quality Icon Sets

September 18th, 2008

Web designers always have their eyes open for design elements to use in their next web project. So I don’t need to tell you the importance of icons and how they help with site navigation or with expressing a concept graphically to support a block of text.  Here is a great collection of 55 Free High Quality Icon Sets that will surely come in handy at some point!

Share/Save/Bookmark

Flash Sucks, and so do “Flash People”

September 16th, 2008

There are many web developers (like myself) who absolutely hate Flash.  Yes, we know that it can look cool when done properly.  However, there’s no way around the fact that the internet is successful because it is easy to find what your looking for using google and other search engines.  Flash is still just a movie and cannot be indexed by google.  Information is pointless if no one can find it.  Anyways, there is already plenty of information on the web about why flash sucks, so that’s not the point of this post.

Here is the point: LiveFaceOnWeb.com ( I don’t want to create a link, just c&p it!).  I have been seeing these “flash people” for years, and they won’t die!  When will people learn that the internet is NOT TV!  If some one goes to your website and has no control over what content they look at or at what rate they receive it, your site sucks!  Despite what companies like this say, flash people do not add a “personal touch” to your site.  If anything they add an automated cold and obnoxious feeling.

Here is a common scenario to show why flash people (and music on sites in general) suck:  Your listening to your favorite artist in iTunes and surfing the web…. BAM!!! Your speakers begin to shake violently and distort with the booming sound of an over compressed voice talking about how awesome some company is; you scramble for the audio knob frantically to turn it down.  “What the hell”, you say to yourself as you search for the stop button on this “flash person”.  Unbelievably, some times, flash people don’t even have a stop or pause button!

The Summary: Flash people are annoying, they do not add a “personal touch” to a site, and most importantly they are counter productive to increasing web usability.  You know that angry feeling you get when you watch a shitty movie that was once an awesome book?  Thats the feeling I get when I see flash people talking about things that would have been better as a paragraph of indexable text.

Share/Save/Bookmark

Magento - Rebirth of the Shopping Cart!

September 10th, 2008

A few years back I started getting lots of jobs from clients who were looking to jump in to the world of e-commerce.  At the time, I wasn’t too familiar with the available shopping cart platforms.  So like any good web developer entering new territory, I dove into a sea of google searches.  From this research, I found  that the two obvious favorites in the open source web community were (and still are) osCommerce and ZenCart.  After much more reading, I chose to started using ZenCart whenever possible on all of my e-commerce sites (osCommerce’s lack of a template system was the main factor in the decision).

Fast forward a few years, and my initial wonder with ecommerce development has long since faded.  I’ve come to despise almost every platform I have worked with.  As a developer, you either have to deal with a shopping cart with horrible CMS functionality, or a great CMS with limiting and time consuming shopping cart module setups.

Not to long ago,  I heard mention in a forum of some new shopping cart platform called Magento.  I headed over to their site, checked out the demo, then wiped the drool off of my chin.  I was impressed beyond belief.  The Magento admin section was extremely intuitive and powerful.  I felt right at home as if I had been using it for months.  It was nothing like my first time with ZenCart ( a client of mine put it best, “what the hell do I do with this?” ).  Managing your products is a breeze with a very nice interface, obviously created by some experienced designers.

By far, the most impressive thing about Magento is its CMS capabilites.  You can add new pages, even custom front pages (without special override modules/functions), just as easily as you can add new products.  Magento truely is the best of both worlds : Capable CMS and powerful shopping cart.

Head over to Magento and give the demo a try… you wont be disappointed

Share/Save/Bookmark

editEase - A jQuery CMS Solution

September 7th, 2008

A huge selling point for clients is to give them the ability to manage their own websites.  With CMS solutions like Drupal, Joomla!, and WordPress, its easy for clients to manage their large sites on their own.  However, often times I develop small 4 or 5 page websites that will remain mostly static.  In these cases, it really seems like overkill to have a database driven site just to give the client an option to update their site at some point in the future.  For one, these content management systems can be overwhelming to the casual updater and secondly, it adds more time, and therefore money, to the development time.

So the other day I was looking for a solution to this problem, and I stumbled upon editEase.  It easily takes a once static site, and creates “ajaxified” clickable content areas.  What was once a block of text, now becomes an editable text area.  Its intuitive, easy to use, and fast at making site updates.

EditEase obviously isn’t an ideal solution for larger sites, but it sure seems to do the trick for those small, once static, web sites.

Share/Save/Bookmark

Welcome to My Life

September 7th, 2008

Here I am, there you are, and this is my first post!  As time goes on I will be adding articles about my experiences as a website developer.  I am always learning new things, and discovering new scripts almost on a daily basis.  This will be a place for me to share my experiences and link to all of the great sites I come across.

Share/Save/Bookmark