Embed Tumblr posts in your sidebar!

In the last two weeks I’ve fallen in love with Tumblr. Mostly because it’s SO darn easy to post a photo, link or quote with the bookmarklet. If you look over in the left sidebar of LittleBirdLLC.com/blog there is a stream being pulled in from our Little Bird tumblr. The web is full of amazing things that we see everyday – this is an easy way to collect them as a resource and share them with you.

First, paste the following into a text widget or your sidebar.php file. Replace ‘yourname’ with your tumblr account name.

<script type="text/javascript" src="http://yourname.tumblr.com/js?num=5"></script>

The /js$num=5 is limiting the amount of posts to 5, this can be whatever number you want.

If you look at it now it’s probably a mess. Every element has tumblr css classes wrapped around it so next you’ll want to style it. At the very least you’ll need to change the width so it fits. I recommend using Firebug, the Mozilla Firefox extension, for finding and styling your posts.

/* Tumblr Styles */

ol.tumblr_posts {width: 183px;}
li.tumblr_post {}

li.tumblr_quote_post {}
  .tumblr_quote {}
  .tumblr_source {}
  .tumblr_open_quote {}
  .tumblr_close_quote {}

li.tumblr_link_post {}
  a.tumblr_link {}
  .tumblr_description {}

li.tumblr_photo_post {}
  img.tumblr_photo {}
  .tumblr_caption {}

/* and that's just a few! */

Tumblr makes it incredibly easy to import RSS feeds so all you have to do is import all of your various feeds to tumblr and Ta-da! Instant life-stream.

Comments Off on Embed Tumblr posts in your sidebar!

Launch: littlebirdllc.com


I’ve been working on littlebirdllc.com since last fall. Designed 10 different versions, coded about 6, started in Drupal and ended with WordPress. Do all designers have such a hard time designing their own business sites? It’s just never right, never cool enough, never finished. I decided on Saturday that this had gone on TOO long. Imagine my surprise when I actually came up with a design I liked right after deciding I just wanted to get something up? Design is funny like that. It’s still a work in progress, but it’s something. Thanks for reading!

Little Bird blog 590


Customizing Drupal Menus

As the interface for your website, the menu gets plenty of action. You might want to tune it up a bit, adding something to make it special. Drupal has an extensive API for interacting with the menu items you create.

On our website, we wanted subtext for each primary menu item – as you see above. Drupal usually displays the link titles only. There is a description field for each menu item, and we thought that would be a great place to enter the subtext we enter. I set out to generate my own menu and place it in a block on my page. menu_navigation_links() looked like a promising function from the menu API.

I enabled the devel module and put the execute PHP block at the top of the page. I got to work creating the PHP that would do the trick. Dealing with arrays can be tricky if you don’t do it often. Using the PHP function print_r() , you can view the contents of your menu array. Like so:

< ?php
$menuitems = menu_navigation_links('primary-links', $level = 0);

Once you have the PHP worked out, make sure the PHP filter module is enabled for the site under admin/build/modules. Create a block at admin/build/block. Insert PHP code and change the input type to PHP.

< ?php
//Get the menu structure and place in a variable. An array is returned.
$menuitems = menu_navigation_links('primary-links', $level = 0);

//Loop through the menu items, setting two classes for the design and outputting what we want
foreach ($menuitems as $key=>$value)
echo '
echo ''.$menuitems[$key]['title'].'';
echo ' 
echo $menuitems[$key]['attributes']['title'];
echo ' 
echo '


More information on the Drupal menu API for all versions:


Comments Off on Customizing Drupal Menus

Aw, we like you too!

© 2018 Little Bird LLC » Email