Showing posts with label drupal. Show all posts
Showing posts with label drupal. Show all posts

Friday, March 12, 2010

Presentation slides for Drupal Camp Nashville "Intro to Theming" presentation

I am delivering a presentation at the March 14th Drupal Camp Nashville entitled "Introduction to Theming: Converting a static HTML + CSS site template into a drupal theme."

Here is a link to the slides from that presentation including relevant links - only slightly uglified by Google docs' translation of a keynote file into a cloud-based ppt file format:

https://docs.google.com/present/edit?id=0AXNi09WiGsTWZGNjM3Jxa3RfNTdmZnc0amtkeA&hl=en

If you have any questions or comments, please add below.

cheers,
Jon

Saturday, March 6, 2010

Conflicts between Cufon module and WYWIWYG module for Drupal


WYSIWYG toolbar displaying correctly

So I was finishing up a site built on drupal - doing all the little clean up activities in order to flip the site live. I ended up needing to upgrade a couple of modules, adjust the caching, and just generally making a bunch of little tweaks. I was just preparing my email to the client to give them the low down on the new site, when I noticed that the WYSIWYG toolbar was not showing up in the node BODY for any content type. As I was just about to walk the client through the site and explain how wonderfully easy and intuitive it was going to be to administrate their site content, the sudden loss of a WYSIWIG environment right at the 11th hour was a bummer.

WYSIWYG toolbar disappears with CUFON module enabled

I had set the site up with the WYSIWYG api (http://drupal.org/project/wysiwyg) and the FCKEditor libraries (http://ckeditor.com/download). I really like the flexibility and power of this implementation, though it has taken me a while to get used to all of the myriad pieces and configurations... Such that you must install the module, then install a library, then configure the Input formats (admin/settings/filters) for the site (I always forget to enable the p and br
tags within the filtered HTML [admin/settings/filters/1/configure]), as well as configure the WYSIWG module settings (admin/settings/wysiwyg).

Anyway - Somehow someway I had introduced a conflict into my site which was preventing the WYSIWYG toolbar from showing up. I spent then next 3 hours tweaking setting, enabling and disabling modules, and just trying to get the WYSIWYG toolbar to show up. I reinstalled that module, switched libraries... no dice.


The culprit discovered in CUFON settings

Finally, I was able to deduce that if I disabled the cufon module (http://drupal.org/project/cufon) the toolbar would come back.  The thing is, the cufon module is totally awesome, and I was loathe to remove it from my site. So, I uninstalled and reinstalled and jumped though all of those hoops. I dug deep into all of the WYSIWG settings - and reinstalled that. Stranger still, I ended up looking at another site I had done and noticed that it was running the same versions fo WYSIWYG and CUFON and the same libraries - and that site was working!

Finally, right as I was about to give up, I went back and looked at the CUFON settings and noticed one selector field that had a font assigned to an empty selector. I set that font back to "-----" and... SUCCESS.

Anyway - hours out of my day on one stupid bit of carelessness. As my google searches in trying to rectify were totally fruitless, I hope this post may help people find a quicker solution to a small but frustrating problem.

Tuesday, February 9, 2010

Weirdness with ImageCache in Drupal

So I was just helping a friend set up a site for a 501c he is doing, and i decided to do it in drupal. Images will play a big part, so I set up a gallery using CCK, Imagecache, and lightbox. Within Imagecache, I setup 2 configuration: a small 100 x 100 scaled and cropped square for thumbnails which - when clicked - open up a zoom preset in a lightbox window. I had set my zoom preset to have a widht and height of 680px, with the understanding that the image would be resized so that the long edge was 680px, but the picture maintained aspect ratio.

This was all fine and dandy for most images, but for a collection of images, the zoom preset just did not get produced. I would pop up the image and get a little error image not found logo in my pop up. The strange thing is that the original image was viewable in the node, and all of the other presets were working. I flushed imagecache a coupla times, which resulted in one of the 4 problem images resolving. Weird.

Ultimately, I found that by limiting ONLY the width and leaving the height blank in the imagecache preset, I was able to get everything working. Unfortunately, that doesn't really solve the mystery.

http://rwwr.org

Sunday, August 9, 2009

Optimizing Drupal Pathauto settings for SEO and ease of use

I am building out a rather robust site in drupal, and while I have worked on several drupal sites in the last several months, I am taking a little more time with this one... trying to set myself up with a viable dev blueprint, if you will.

I have enabled pathauto to help with SEO, and now am trying to optimize the pathauto settings for each content piece. One of the site content types is a blog. Many blogs list articles by date, and I often find date incredibly relevant in my searches, so I was thinking of setting a path as site.com/blog/yyyy/mm/blog-title. In exploring the viability of that, I stumbled across this article (4 reasons to avoid using dates in urls) , and must say that I see the sense in the article. The only thing that gives me pause is that I often come across an article where a pub date is not readily apparent - and I can get pretty deep into it before I realize it was pubbed in 2005 and is not really relevant. However, that is from a reader's point of view, from a content provider's point of view, it does not benefit to add date. Best bet looks to treat blog recrds the same as news records...

As to news items, google does a pretty good job of laying it all out for on optimizing for placement in google news. The only thing that really stuck out to me was that, in including a thumbnail img with the news article, making the img a link is a detriment. The big thing for placement on google news is the 3 digit number which need be associated with the article, which can be handily added via pathauto using the [nid] token. Consequently, I have news paths set to "news/[title-raw]-[nid]" - I keep the /news/ at the top as it follows the sitemap, and the user can delete the article title from the address bar and then end up at sitename.com/news/ - which is a real page listing all news, which makes sense from a usability point of view.



The primary rule of thumb I have decided to follow is that paths should follow site map structure, such that you should be able to follow the path back up to the home page in a logical way. So, if you have www.sitename.com/news/press-releases/article-title-001, you should be able to back up at the address level so ../news/press-releases/ lists all press releases and ../news/ lists all news inclusive of press releases, and so on.