Image handling in Drupal
Being able to accurately control the size and dimensions of images is vital for any modern website. Nowdays, different media types are commonplace because broadband has become ubiquitous. Because of this, websites have the opportunity to show off far superior and more interesting pages to the average visitor. But being able to handle images on the fly is not something that is necessarily too easy to do - unless you have a well designed web platform.
Drupal 6 requires us to make use of the excellent ImageCache contributed module in order to properly apply effects and styles to class of images. Site prebuilder distributions all come with this module built in and as of Drupal 7, much of this functionality is included in core (about time).
Here's how it works:
- download and enable the ImageCache module (if necessary)
- Go to ImageCache under Site building and select the Add new preset tab
- Supply the new present with a suitable name (one that relates to it's purpose - for example, blog_thumbnail, or small_list_image) and click Save preset
- Select the style/actions you would like to apply and configure each one accordingly (for example, you might want to restrict the width of images to 200px. In this case, use the scale style and set the width parameter to 200)
- Repeat the last step with different styles until the image displays exactly as you require and click Save preset
This preset is now available pretty much anywhere images are displayed in Drupal. You can apply it to images in content and views quite easily. For example, let's assume that you needed the 200px width preset to apply to all images shown in blog posts:
- Click on Content types under Content Management
- Select edit for the blog entry type (or whichever type you wish to work on)
- Click on the Display fields tab and select the relevant Image field
- Select the preset from the dropdown list in the full node (you might wish to make a separate preset for teasers) andd Save the changes
Now any blog images are displayed using the assigned ImageCache preset. In the same way, images in Views can be controlled by configuring the display options in the field outputs for any images shown. A good example of this are the two blog posts shown in the right hand column of the Site prebuilder website.
You are online with David Mercer
"Bestselling author of books about the web, eCommerce and marketing." Wikipedia
Inspiring and empowering entrepreneurs, businesses, bloggers and startups through social, marketing, and business advice.
30 000+ readers and counting
"This made my day" - Guy Kawasaki
Author of Enchantment and The Art of the Start
Sponsor this webpage for cents a day
- Real SEO backlinks
- Premium page position
- Large ad space
- Displays every hit
- Targeted audience
- High conversions
Become a recognized visionary
Share your insights into the future of your niche. Gain a following and drive brand recognition, traffic and sales.
Social SEO website reviews
Add your site to the world's premiere web directory and bookmarking service. With social integration and SEO juice to deliver multiple backlinks & great ROI.
Boost book & product sales
Track, analyze and promote any book or product sold through Amazon, anywhere in the world from around 3c per day.
topulo.us predictions
- Social influence will overtake web traffic as the primary metric for advertisers and marketers
- "Steve jobs" by Walter isaacson will sell more than 200 000 copies in 2012 on Amazon.com alone.
- Apple's iPad will sink below 50% market share by mid 2013
- Google search plus your world will kill off Twitter within two years
- Cloud printing with cloud ready printers will kill off the fax machine
TopRank
- Online Marketing News: Facebook IPO, Harmonize with Google+, Pinterest Dominates Traffic
- Essential Shifts in Online Marketing: Are You On Board? Are You Optimized?
- Blogger Relations: Push or Pull? How to Get Bloggers to Mention Your Brand
- Getting Your Internet Marketing Dream Job: How to Interview & Succeed at a Top Agency
- Google+ Optimization vs. Community Building: Pros & Cons of Google SPYW
terms of use | privacy | about | write for us | affiliates | employment | partner with us | advertise | contact
© site prebuilder 2009





















