Aug 05 2009
Aug 05

I thought I would share with the rest of the community this great little time saver. FireQuery, needs Firebug, allows you to query the DOM and see what changes take place - without saving a file or refreshing the page. Just like testing  CSS changes in Firebug.

I am not a whiz with jQuery, though the logic is simple, the syntax is still new . Trail and error can be a slow method to learn a new language / technology but, Firequery got me to the point of failing quicker - to learn more quickly. If that makes sense... Before I knew it I was writing my own jQuery plugins.

A big thanks to binaryage for this very needed tool! I know jQuery newbies find it useful and am sure jQuery pros do too!

May 31 2008
May 31

Shopping.com API Update

On May 14th, 2008 Shopping.com released the new version (version 3) of their API, the Shopping.com API, commonly called the SDC API. If you were a Shopping.com API version 2 user you will be very happy to see such changes as:

  • Unified Schema - category, products, offers, reviews and hybrid results are all in one unified xml schema.
  • Single Calls - in version 2 if you needed store offers on a category call you would have to make another call, per product sometimes, burning up lots of your 250,000 limit. Due to the unified schema and new filter options you just need to make one call.
  • Sorting products, offers, and reviews is much more efficient now. No more multiple calls to get a sorted result.
  • Version 2 was plaqued with parameters that didn't make sense when first read, like tp, befid, sam, np, nm and more. Version 3, the parameters are very easy to understand and you know what is happening in the query due to the renaming of the parameters. IE, showProductOffers, showProductSpecs, showProductReviews etc.
  • Java developers have more help this time around with the SDK kit, a set of Java classes to develop a working product much quicker.
  • There is good documentation, this time around, for the XML Schema, Use Cases, and REST Option Reference.

If you were a Shopping.com API version 2 developer or user you will welcome these changes, sooner or later. Shopping.com is going to give all partners 1 year to upgrade to the new version. At first, I thought this was too much to ask but after reviewing the lengthy white paper I changed my mind. A developer familiar with the old Shopping.com API will reconize right away the benefits from the new schema. A big thank you to the Shopping.com API engineers!

Drupal Shopping module

The module (never was released to the public) developed for Camera Prices in 2005 was built for version 2 of the Shopping.com API and coded for Drupal 4.3. Very outdated. A few months ago I began blogging about the Shopping.com API, releasing this Drupal Shopping module to the community, and what to expect from the module.

Upto a few weeks ago I was about 65% of the way through building this module, before version 3 of SDC API was announced. Since I am not finished with the SDC version 2 of the module I decided not to support Version 2 and work towards version 3 instead. Unfortunately the changes are significant and require a rewrite of the "request" and "response" parts of the module. The XML Schema has changed as well which requires all sorts of rule changes within the module code as well module settings.

Last week I began planning the module architecture. As of today I have finished the "request" part of the Shopping module. This weekend I look forward to testing it and getting the "response" code built up. I am finding developing this module for SDC Version 3 is going much quicker than I expected.

LinkedIn Group - You're Invited

I have started a LinkedIn Group for those interested in the Shopping.com API and this Drupal Shopping module. Feel free to join to network with others or just to receive updates. As of today there are 9 members in the group, which I hope a few will do beta tests once the module is available. :)

Shopping Module Website

In the coming months I will be launching a website to introduce the module, provide a demo, and show how to make mashups with the Shopping module and othe
r great Drupal modules. Stay tuned!

May 20 2008
May 20

Challenge

Spend 10 minutes 3 times a week for 4 weeks answering questions in Drupal.org forums. When? Starting July 1 (2008). What's that? "I don't know enough yet" OR "I'm too busy developing core". Don't make up your mind just yet. Read on...

Why?

If you could measure adoption rate throughout Drupal.org, my hunch is that the Forums create a faster adoption than Drupal Groups, Modules, Issues etc. The forums are lacking responses and that adoption rate is slowly declining (IMO).

Newbie's live in Drupal forums. If they can't find what they are looking for, they will move on - leaving the love from Druplicon behind. In sincerity, why again, because you have knowledge that someone else doesn't. Chances are you started out in the Drupal forums. And, the forums need a new breath of life from the Drupal community.

Drupal Stengths

First, find your Drupal strengths. What are you good at? Theming? Coding Modules? FAPI? Drupal setup? Certain modules? D5, D6, D7? You decide. I suggest focusing on two areas of Drupal you are really good at (or two modules you know inside and out) during the challenge. If you created a solution, not available on Drupal.org, blog about the solution or check the forums to see if someone had a similar problem - then share. Think your strengths and your humble beginnings as a newbie - not about wasting your time on a newbie.

Finding Posts

Here are a some ways of finding the posts you can answer - using your Drupal muscles strengths:

1. If you are new to contributing to the forums you might start on the main Drupal forum page. To search by a specific keyword you can use Drupal forum search. Don't be afraid to use the "advanced search" feature to narrow your results.

2. Chances are you use a RSS reader to keep up with news on the web. All Drupal Forum topics have RSS feeds. Why not add a few Drupal forum topics to your RSS reader; give Druplicon some love and put your RSS reader to work.

3. Use Google and the site: command. One of my favorite ways to find content for a specific site is using the Google site operator. Here is an example.

4. Narrow down your searches using Google "site" command AND date feature in Google advanced search. By narrowing down by date, let's say the last 3 months, you can find recent posts quicker.

Thinking Like Newbies

This next step is actually hard. We have to think like newbies! When searching for posts to answer try to look for keywords that a newbie might use in the post title or body. Remember, they aren't going to know the Drupal lingo just yet.

Refer to Drupal Documentation

The Drupal Documentation (Handbooks) team has worked hard at getting good documentation up. Refer newbies to the documentation when possible, it will cut down their "hold my hand" time and mature them into adoption quicker. If you know of other sources outside of Drupal.org content don't hesitate referring the newbie to that source.

Summary

The goal of this challenge is to enhance Drupal adoption for newbies. The strategy is not to help anyone and everyone but to specifically use your Drupal strengths and refer newbies to reliable sources (Drupal Handbooks etc). If just a small percentage
of active Drupaler's participated in this challenge, we will see a positive change in the community that will have a lasting effect.

Poll

Use the poll on the right to show our participation. Feel free to comment on the poll to be automatically updated on July 1st.

May 19 2008
May 19

Over the last couple of weeks I have been planning how to introduce, educate, and train Drupal to the Purdue University campus. Although nothing is in place permanently, the introduce and educate parts will be done primarily through presentations on campus. To start the presentations, I first need to understand what steps the average "Purdue University web publishing user" performs just to publish a piece a content. Each department has their own way of doing things, so I will need to research and interview different departments to know what to present.

I have already conducted a few interviews: 2 faculty, 1 staff, and 1 grad student. Everyone but the staff interview agreed that it is too difficult to publish content through the university procedures. The staff interview doesn't surprise me; he is part of the IT group for the Foreign Language and Literature department (he is techy). Over the coming months I will publish my findings in detail, hopefully it will be helpful for another Drupal group leader reaching out to a university environment.

May 14 2008
May 14

Task

Recently a client asked for a simple yet flexible and scalable solution to modify the user profile output for a particular role (client is using the profile module). The client also wants to grant this role full html privileges with certain profile fields.

By default, the profile.module runs each field through a check_plain() or check_markup() function (see function profile_view_field() inside profile.module).

It is necessary to override the user_profile() theme function to prevent the content from being ran through "Filtered HTML" input filter - initially done through check_plain() and check_markup() functions.

Step 1

To start off with, override the user_profile theme function within template.php (found in your theme directory):

<?php
function phptemplate_user_profile($user, $fields = array()) {
if (
$user->roles['5']) {
return
_phptemplate_callback('profile_special', array('user' => $user, 'fields' => $fields));
}
else {
return
theme_user_profile($user, $fields);
}
  }
?>

Step 2

Create the profile_special.tpl.php in your theme directory.

Step 3

Add the following to your profile_special.tpl.php file:

<?php
 
// an example to allow the user's profile content to run through the "Full HTML" instead of "Filtered HTML" input filter:   $output .= $user->profile_my_field;
 
$output .= ''; // customize me to your liking...   // print '<div class="profile">' . check_markup($output, $format = 3, $check = TRUE) . '</div>';
 
print '<div class="profile">' . check_markup($output, 3, FALSE) . '</div>'; // see comment below
?>

$format = 3 is the "Full HTML" filter id for the client's site. If you have removed your default input filters, this $format = 3 will not work.

$check = TRUE tells the function to make sure this visiting user has has permissions to view the filtered output. If FALSE any visiting user can see the filtered content.

Summary

By overriding theme_user_profile() you can serve up many different layouts based on a number of things: $user>fields, $user->profile->fields, roles, your user id vs others. The list goes on. This is a powerful technique to use Drupal core modules and still get the look/behavior/features you desire.

To take this method of overriding the profile page even further, you can easily pull in content from views, cck, or a query of your choice. The options are endless.

Important!

You should always run profile fields (and others like views and cck fields) through a Drupal check_plain() or check_markup() function. Learn more about writing secure code in Drupal.

Special Thanks

Thanks to webchick and heine on IRC for answering questions related to the profile module and check_markup() function.

Apr 14 2008
Apr 14

Template Monster that is. Template monster has decided to offer Drupal templates.

I am glad to see this happen. I have said many times in the Drupal IRC channel that Drupal needs to get more CSS'ers involved. Or, get more freelancer themers involved, like those from Joomla and Wordpress.

It is my belief that WordPress became so popular so fast was due to it's themers, cranking out themes day and night. Now those themes are a commodity on SitePoint. You can't find Drupal themes there, mostly WordPress and sometimes Joomla themes.

My only concern about Template Monster stepping in, will they output some great themes that show the robust of Drupal? And continue to keep that standard up? I guess that falls into the hands of their designers and CSS coders. What ever the case may be I am glad to see design related companies to notice Drupal.

Congrats to the Template Monster team for taking the leap of providing services for Drupal.

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web