Search This Blog

Thursday, July 24, 2008

Q&A: How to pull widgets into Drupal and how to create a new block

So, I thought instead of just answering questions via my mailbox or the comments, I would take those questions and expand them into a little post.

Question: How to put a widget (Youtube badge, del.icio.us feed, facebook profile, etc.) you into Drupal? What module is needed?

Answer: While there are modules for many social networking sites, depending on how the content will be used, a module may not be necessary. If all you want to do is pull content in, then creating a block with the widget code enclosed is all that is needed.

If you are not sure what Drupal is and need some help getting started, may I suggest my Drupal Overview? ..and other shorter overview. Okay, now that we have that out of the way, to the easy.

Step 1 -- Get the widget!
  • Make your widget and get the code -- you can either use widgetbox, or go through various services (the youtube website) or you can just google want you want to do, like make a flickr badge.
  • Save the code snippet in notepad, or an email, or someplace easily accessible.
Step 2 -- Create a new block in Drupal
  • Open and login (as Admin) in your Drupal site. Go to Administer > Site building > Add block







  • Give your new block a name -- this title will appear in your Admin menu (in other words this one is for you!
  • Give your block a new public title, e.g., the header for your content.
  • Past in your widget code.
  • Under Input > Choose Full html! Your widget will not work otherwise!
  • Set user preferences and public availability, if desired. In other words, you can control who sees this content and who doesn't as well as where they see it. For public and across the site, just skip these, two sections.
  • Save!


Step 3 -- Assign your block to its spot on your website. Otherwise, it will not show up. You've created the content, now put it on your page.

1 comment:

anacaona said...

Thanks - exactly what I was looking for!