Drupal

CKEditor Skin

CKEditor default skins are fugly, up until now I've been using the Office2003 skin due to lack of available skins for ckeditor that don't look like puke, I've started on my own. Not all parts are themed, just the functions I use. Icons are Famfamfam silk and base skin is Office2003 from ckeditor. I've tried to keep it simple, colourless and plain. I plan to update the skin as i discover bugs and or require new features. Please send comments or contact me if you have any suggestions, etc.

Now that jQuery UI is included in D7 core, we'll see a lot more application style functions using the UI library. Here's a quick example for adding an accordion to node content (enable and select PHP filter) demonstrating how easy it is to add jQuery UI effects and widgets in Drupal 7.

I would like to share a code snippet for a site I'm currently developing which I thought was particularly cool.

The following code adjusts the page margins in a dynamic fashion and is nice on the liquid layout I'm designing. Basically it sets the page margins (or padding in this case) logarithmically (sort of) so in a really wide screen there's heaps of margin and on low res (1024 wide) there is very little. Percentages didn't cut it.

  1. Lack of attention to title tags or leaving title tags as automatically generated on important pages or having duplicate titles. The single most important thing you can do to improve Drupal SEO is improve page titles - Page Title module
  2. No quality backlinks. This will take a huge effort, back-links or inbound links from related sites, suppliers and clients will help bring traffic and build SEO. For goodness sake do not buy back-links.

I've been working on the Drupal 6.x dev version of the Andreas03 theme (http://drupal.org/project/andreas03) for which there is no left sidebar region. I was kind of stuck on the regions where on a fresh installation, enabling the theme automatically put the navigation/login in the header by default.

I needed to add a body class for node edit pages. Heres the code for template.php

<?php
function phptemplate_preprocess_page(&amp;$vars, $hook) {
 
// node-edit class
 
if (arg(2) == 'edit') {
   
$vars['body_classes'] = $vars['body_classes'] .' node-edit';
  }
}
?>

I wanted an edit icon on my views edit node links. Using the views field template I added the following to the template file: views-view-field--edit-node.tpl.php

<?php
  $output
= preg_replace(
   
'#(<a[^>]*>)[^<]*(</a>)#',
   
"$1". theme_image(path_to_theme(). '/images/icons/edit.png') ."$2",
   
$output
 
);
  print
$output;
?>

Now all my views have a nice edit icon for each node row. The image: Edit

And to go one step further, display the edit icon only when hovering the row this is added to the css.

I wanted something different to replace the ajax animated gif (Drupal throbber) so here it is:

Also, see my post Change throbber.gif in Drupal for instructions on replacing throbber.gif without effecting core.

To replace core Drupal ajax animated gif (throbber.gif) add the following to your theme's CSS and put the replacement throbber.gif file in the images folder of your theme.

html.js input.form-autocomplete {
  background-image: url(images/throbber.gif);
}

Top 5 Drupal Modules

  1. CCK - of course!
  2. Admin Menu - I've been using this since D5.x and it really changed my life.
  3. Image Cache (Image API, File Field, Image Field and Image Cache) - Really the only way to add consistent image content.
  4. FCKeditor (IMCE, Image Resize Filter, Better Formats and FCKeditor) - For the end user or client, why do they still get into trouble? 
  5. Google Analytics
Syndicate content