Drupal modules

Having trouble targeting page titles with CSS when using Views?

Sometimes, in a Drupal-based site, I want to do something to a certain title with CSS, which is easy if the title is on a node. But what if the title is on a View? Well, I’ve used this simple snippet with success to give the title of the Views page a unique id, allowing you to target it with CSS.

In the page.tpl.php file of your theme, find the area of code where your title is set. Insert the following code above.

<?php 
 $illegal = array("'", ",", " ", "-", "/", "&", ":", ";", "|", "–", "—");
 $uniquetitleid = 'title-'.strtolower(str_replace($illegal, "", $title));
?>

Then, replace the following code (or similar):

<?php 
if ($title): print '<h1 class="'. ($tabs ? ' with-tabs' : '') .'">'. $title .'</h1>'; endif; 
?>

with this:

<?php 
if ($title): print '<h1 id="'.$uniquetitleid.'" class="'. ($tabs ? ' with-tabs' : '') .'">'. $title .'</h1>'; endif; 
?>

This code simply takes the title of the page, strips some characters, converts it to lowercase, and turns it into the unique id for the <h1> element that contains the title. Obviously, this code won’t be very helpful if your title is based on arguments – unless you are wanting to make certain argument-based titles look different for some reason. Let me know what you think.

ENGINE Launches E-commerce Site for FOG Free Technologies

FOG Free Technologies needed to make their cleaning chemicals available online. Engine handled branding, overall online strategy consultation, user-interface design, Drupal theme development, e-commerce development, and search engine optimization and marketing.

The site’s focus is, of course, selling products. Every page is designed to lead to the store, where customers can order with ease.

We created a clean user interface that could easily be expanded as the store’s offerings grew. Its color scheme was inspired by FFT’s environmentally friendly wastewater solutions.

Part of the SEO strategy was making an article-based reference catalog. We brainstormed actual reasons why customers would need FFT products (including many based on true stories), then wrote Solutions for each of these problems. These are all tagged and keyword-conscious, great for SEO.

Tools we used included Drupal, Ubercart, Paypal, and several key Drupal modules like the Drupal taxonomy system and Thickbox.

FOG-Free-Technologies-website-by-ENGINE-Industries.jpg

Online Overhaul for Lewallen Construction

Atlanta, GA - Lewallen Contruction recently chose Engine Industries to redesign and rebuild the Lewallen Construction website. With a great brand identity, Lewallen Construction needed an online presence reflecting their quality work.

Many of Lewallen’s potential clients are international… meaning Lewallen’s website has one chance to make a good impression. It was essential to make a site that could be updated frequently with new services and project photos, and that could be used with little effort.

The result is an easy-to-use website that is well-organized and presents the user with a no-nonsense interface… quick and simple.

Tools used to build this solution included Drupal, Views, and Thickbox.

Lewallen-Construction-website-by-ENGINE-Industries.jpg

AddToAny

Share/Save