[development] Changes to capitalization

Gary Feldman dpal_gaf_devel at marsdome.com
Wed Sep 13 21:54:41 UTC 2006


Gabor Hojtsy wrote:
> On Wed, 13 Sep 2006, Boris Mann wrote:
> ...
> function azigazi_menu_item_link($item, $link_item) {
>   return l(wllib_ucfirst($item['title']), $link_item['path'], 
> array_key_exists('description', $item) ?  array('title' => 
> $items['description']) : array());
> }
>
> Look, it is so easy. Note that this is Drupal 4.6 theme code used on 
> Weblabor.hu. In Drupal 4.7, you have a built in drupal_ucfirst() 
> function to use. The wllib_ucfirst() function is our custom library 
> function for this, but does just the same.
This won't work if the menu item is something like "eBay Listings", for 
example.  Sure it's a bit contrived, and wouldn't apply to Drupal's core 
modules, but it's a legitimate case.  The core should not assume that 
this is a viable solution in all situations.

A different argument is that this requires PHP, yet as people have said, 
it's a theme issue.  For theming customizations, CSS solutions should be 
preferred over PHP solutions, just to better meet the needs of designers 
who are less familiar with programming.  As has already been pointed 
out, the CSS facilities aren't nearly smart enough to do capitalization, 
but they work fine for doing all lowercase or all uppercase.

Gary





More information about the development mailing list