Lijit

Integrating and Customizing Lijit for Your Site

Aug 4th in Tools & Tips by Thord Hedengren

Search is an important part of any website, and a lacking search functionality will mean that your visitors won't find what they're looking for, never a good thing. If you're a WordPress user, you know what it is like, because WordPress, like so many other online publishing platforms, just can't be as good as Google is. However, there are solutions. You can swap your search solution with something else, be it Google Co-Op, or Lijit. In this tutorial, we'll take a look at Lijit, which will let you search across several sites, as well as multiple social webapps out there.

PG

Author: Thord Hedengren

This is a NETTUTS contributor who has published 4 tutorial(s) so far here. Their bio is coming soon!

Lijit sparked my attention as a serious option to the overall pretty excellent Google Co-Op solution with their inclusion of the social sphere. I can easily add my YouTube, Flickr, Twitter account, and a lot more above that, for inclusion in the search queries sent through the Lijit search box on my site. That way, a user can search across all my presences online, bringing them closer together. That is, of course, a good thing.

The Brief

I'll use my own site, tdhedengren.com, as an example for this tutorial. It is in a sort of redesign mode, far from finished, which means that it is OK to play with it. Actually, it would be anyway, it is mine after all, but that's beside the point. I'm running WordPress, but there won't be any WordPress specifics in this tutorial, since it doesn't matter to Lijit. I've got the search functionality from WordPress already, but I'm removing it in favor of Lijit.

So let's get started!

Step 1 - Getting Lijit

Signing up to Lijit is ridiculously easy. Just visit lijit.com and type your URL in the field, and you'll be thrown into a guide where you can tell Lijit where you've got an online presence, add blogs and sites you want to be included in the search, beside your own of course, and things like that. In fact, you can even ask Lijit to pull the blogs from your blogroll into your search, a nifty feature if any.

Lijit Signup

The list of online services is easily edited. Just click tha checkbox and fill out your username (you'll get a check link when done typing, to make sure it is the right user on that particular online service), and you're done.

There are a lot of online services and places to choose from, including MyBlogLog, Digg, Viddler, Tumblr, Disqus, Reddit, Facebook, and a bunch others, beside the ones already mentioned. And should your online poison not be there, you can always submit an URL or RSS feed, and Lijit will add it to the network.

Lijit checkboxes

These things are pretty straight forward. When you're done, you can get your Search Wijit, which is the search box we want to integrate on our site. If you get lost in all the account settings and other things, just click the link in the top top right called My Search Wijit and you're good to move on to step 2.

Step 2 - Integrating the Search Wijit

It is easy enough to get the Lijit search box, called the Search Wijit, on your site. Just click My Search Wijit in the top right when logged in, choose a Wijit Style, color, and logo color, make some other pretty obvious picks (add/remove features like a popular searches keyword cloud, icons, and so on), and save the settings. Clicking Install the Wijit button will get you your code, and then you just need to copy-paste this to where on your site you want the Lijit search box to be. It is simple enough. When installed, you won't have to install it again, you just change your settings and save, and it is there automatically on your site, since everything is fetched from the Lijit servers.

However, let's not get ahead of ourselves. Back to my blog. I wanted the Lijit search box up right away, so I unchecked all the extra features (content icons and so on), picked the Big Rounded style, Grey color, and Grayscale for the logo color option. The preview shows how it'll look, but I put it up anyway, setting the width of the Search Wijit to 280 which I know would fit my sidebar.

My Lijit Settings

Simple enough, right. Clicking Install the Wijit gives me a page where I can do quick installs if I have a TypePad or Blogger blog, but since I'm a WordPress user, I get a simple JavaScript code snippet to include.

<script type="text/javascript" src="http://www.lijit.com/informers/wijits?username=tdhedengren&js=1"></script>
<a style='color: #999' href='http://www.lijit.com' id='lijit_wijit_pvs_link'>Lijit Search</a>

Since I think that the Lijit logo is enough, I removed the link, and then pasted this code in my sidebar, where I previously had the WordPress native search box.

<script type="text/javascript" src="http://www.lijit.com/informers/wijits?username=tdhedengren&js=1"></script>

Simple as that, I've got an integrated search solution powered by Lijit. The great thing is that search results are served in a layer floating above my site, which means that visitors searching for something on my blog won't have to leave, unless they get a hit from any of my other online presences (be it a story on Devlounge, a tweet, or something else from my network), which then will lead to this place, of course.

Basic Lijit
Lijit Search Result

Simple as that, it took a few minutes playing around to get my very own Lijit search on my site.

Just for fun, let's see how the search box would look with all extra bling-bling enabled, like keyword clouds, extra buttons and icons, and so on.

Lijit Bling

No, I don't want that, it is too much for me. I like the more minimalistic approach, serving up content from all my online presences when people ask for it (ie search), rather than pushing it forward in this way. But that's up to you, you might like it!

Step 3 - Customizing the Search Wijit for Your Design

While I do think that the Lijit search box looks OK with these basic settings, naturally, I'd like it a bit more customized for my design. This is done by adding some CSS to your stylesheet, which will control the design of the Lijit box just as it would when doing a traditional search form.

However, before you can do this, we'll need to visit the My Search Wijit page again, and choose Style My Own from the Wijit Style dropdown menu, and save. This will change the Lijit search box to something we can style using CSS.

Lijit- Style Your Own
Basic Style Your Own

Not too pretty anymore, but we'll fix that. For me, I want a clean and simple form just like the ones I have for posting comments and whatnot on my site. There is not many CSS elements we need to mess with.

  • #lwp_main is the main div container
  • #lwp_sfb is the form
  • #lwp_sfd is the input box
  • #lwp_2_searchbutton is the submit button
  • #lwp_ps is the container for the search cloud

By adding these to your stylesheet, you can easily style the Lijit search box to fit your design. I just did some minor edits:

#lwp_main { float:right; width: 130px; text-align:right; } /* main div */
#lwp_sbf { overflow:hidden; margin:0; padding:0; } /* the form */
#lwp_sfd { width: 110px !important; margin-bottom: 3px; padding: 2px; border: 1px solid #555; text-align:right; } /* the input box */
#lwp_2_searchbutton { background: #555; color: #fff; font-size: 12px; font-weight:bold; border: 0; text-transform: lowercase; } /* the submit button */
#lwp_2_searchbutton:hover { background:#0c1; }
#lwp_ps {} /* the container for the search cloud */
#lwp_f { width: 130px !important; }

The result is a floated little search box in my larger search box. Since #lwp_main is the containing div, I used that one for this, and put in my own code to float a div with the small informational type to the left. Naturally, you can do a lot more fancy stuff using the custom CSS, so find whatever fits your site and go with it. Most likely, all you'll need to do is take your current code for your searchbox, and put this in the corresponding Lijit CSS element in your stylesheet.

My Lijit

Step 4 - Search Result Variations

Personally, I like the layered div that displays the search result above my design. However, if you want to really embed the search result on your site, this is possible to. It works pretty much like Google Co-Op, which means that you'll create a page on your site containing a code snippet that will display your result.

Setting it up is a breeze. Just go to My Search Wijit and chose On my blog (advanced) in the Display search results dropdown. Then write the URL to your search result page, and paste the code listed in the box below on this page. That's it, very simple, just don't forget to save your settings.

Custom Results

Finished! That's it! As you can see, the amount of work needed to get a working Lijit search on your site is minimal. If you want to customize it, you'll need to mess around a bit more, but it is really more of an issue with your current site's code and design, rather than something clunky in Lijit's interface.

The pro and cons of going with Lijit rather than Google Co-Ops can be discussed, of course. The latter offer the option to include your very own Adsense code, which could generate some money, but Lijit has got the social web thing going in a cooler way. If you've made this choice, feel free to share your reasoning, as well as your verdict should you have one.

Happy searching!


Related Posts

Check out some more great tutorials and articles that you might like

Enjoy this Post?

Your vote will help us grow this site and provide even more awesomeness

Plus Members

Source Files, Bonus Tutorials and
More for $9 a month for all TUTS+
sites in one subscription.

Join Now

User Comments

( ADD YOURS )
  1. PG

    Michael lawless August 4th

    looks great… going to read it tonight cant wait.keep up the good work nettuts love the site!!!!!!!!!

    ( Reply )
  2. PG

    Simon SC August 4th

    Thanks for the top tip. The fact that it can be styled like CSS is a big plus. I currently use Google CSE on my site* but I was always hoping for one more “integrated”. By the way, the re-design looks gorgeous!

    * see here: http://rwsoft.method8.net/search/

    ( Reply )
  3. PG

    Jonathan August 4th

    Been wanting to try out lijit for some time now, but (you know the story) thanks for lifting my interest up a notch. Will look into it tomorrow.

    ( Reply )
  4. PG

    Aaron Brazell August 4th

    Great post. Passing that on to the team as a reference. :)

    ( Reply )
  5. PG

    Braden Keith August 4th

    The images have a bad quality vibe because their smaller than their actual dimensions, hard to make out what’s going on in the picture.

    ( Reply )
  6. PG

    Aaron Brazell August 4th

    Actually, let me also toss out that some people, like yourself, benefit from having Adsense in search. We are very close to opening up an ad platform that will allow bloggers to do this and really control their own inventory, even turning off ads if they don’t want them.

    Secondly, some people really like Google Custom Search and don’t want to give it up. In those cases, I point out that out of the box, Lijit runs on GCS but adds the social content too. We like to think that our own engine is usually better for the other content as well as search, but recognize that sometimes Google’s technology is quite good. So there’s options for bloggers too.

    ( Reply )
  7. PG

    Chris Coyier August 4th

    I love the idea behind ligit. I wish we could get more control over that results page. Ideally, we could remove the ads somehow (paid?). I’d love to replace my WordPress search with this to leverage the much more powerful Google results, but that results page isn’t gonna cut it.

    ( Reply )
  8. PG

    Ben Griffiths August 5th

    This looks like a really good service :D

    ( Reply )
  9. PG

    Barney Moran August 5th

    Whoa: Can you also custom code how revenue based on your private data is being generated, and what % you as the publisher is getting for your original content: However clever we may be at low level coding, remember this: how does the widget make its money, and of this revenue stream, what % is available for the actual Publisher?. Along with the ability to search data is the VALUE of this data. Who owns it? What about each individual blogger’s data and the critical sanctity of Publishers private statistics. We at P.U.B. consider the safety of the information any app or widget(s) may be gathering, unbeknownst to the unwitting Publisher who installs them.

    P.U.B. [Publishers Union of Bloggers] has pending inquires to Widget Providers concerning how they generate their income and what percentage of this income goes to the Blog Publisher making the critical decision to allow a Widget on their site for their readers. In addition we are requesting transparency on the critical issue of how the private statistic from Publishers Blogs are being used, hopefully with the Publisher’s permission!

    P.U.B. expected to hear back from Lijit on these financial and private statistics issues from P.U.B’s inquiry we sent to Lijit in mid April 2008. So far all we’ve read is a public blog response from a Lijit employee advising Lijit has no money, and more recently, we received an email from Lijit’s CEO, Todd Vernon, attacking P.U.B. and falsely accusing we are writing fictitious emails. Any actual answers to our questions about the use of Publisher’s stats, or revenue as it applies to Lijit? Nada. Nothing. P.U.B.’s job is to fight for Publishers by asking the hard questions and demanding answers. If all Widget companies respond as Lijit’s done up to this point, P.U.B. has a big workload for our Publishers, and your membership and support helps us all as Publishers, thanks.

    If P.U.B. gets a straight answer on topic from Lijit, not smoke and mirrors, we will let great Blog Publishers like you know their exact revenue/statistics use/sharing deal. Currently we are also working with Blog Publishers to track performance hit evaluations of Widgets, and the actual ownership of content pulled by widgets from our blogs.

    Will publish these results to keep the community of Blog Publishers informed on this critical component of Widgets on our Blogs.

    Sincerely,

    Barney Moran
    Founder, P.U.B.

    ( Reply )
  10. PG

    Shane August 5th

    Firstly, it’s great that the form fields are showing now – I was trying to add a comment earlier today, and wasn’t able.

    Secondly, Thord – thanks for writing the tutorial – although I love the jQuery stuff, it’s nice to see something that I’m not so familiar with.

    Having said that, I’d like to say that I don’t necessarily agree with this comment:

    “If you’re a WordPress user, you know what it is like, because WordPress, like so many other online publishing platforms, just can’t be as good as Google is.”

    I don’t expect my wordpress blog to spider and index the whole of the internet, but for my site I think it might be a little better. First, wordpress now searches pages for content (it used to just search posts) by default, and I don’t have to wait for google to spider my site, so content I add now is searchable now, and I am also able to style my search results as I wish.

    As nice as the popup is, it just doesn’t feel part of the site, and although it might please some people, I prefer the default wordpress search.

    For some types of sites, this might be just the ticket! Most importantly, it’s not something I came across before, so thanks for the heads-up!

    ( Reply )
  11. PG

    tdhedengren August 5th

    Thanks for the comments, guys! I appreciate it, as this is my first tutorial here on NETTUTS.

    @Shane,
    I’m afraid I can’t agree with you regarding WordPress’ search. I find it failing for larger blogs, if there’s tons of content then it doesn’t do a great job. I find myself doing a Google search to a particular site, rather than using search fields, for older blogs using WP. Still, in all fairness sake, it often does get the job done.

    Thanks for your comment!

    ( Reply )
  12. PG

    Shane August 5th

    @Thord – I’ll take your word for it regarding larger blogs. Mine’s quite small, and I find the default wordpress search does the job well. Perhaps wordpress needs to improve in this area – what do you think?

    I have used a google site: search a lot when I’ve been less than confident of the site’s own search results, and found what I’ve been looking for!

    We’re in the era of utilising third-party sites and services on our own websites, as you say. The post you made discusses google, but there are many sites that utilise other services, particularly twitter, at the moment, too.

    What do you think of Wordpress’ search? Why do you think it fails for larger blogs? How could it be improved?

    I’d appreciate your thoughts. I’m not a search guru :)

    ( Reply )
  13. PG

    Lamin Barrow August 5th

    I have never had of this site search service before but now that i have, i will be sure to check it out. Thanks for the post.

    ( Reply )
  14. PG

    tdhedengren August 6th

    @Lamin Barrow,
    Thanks for reading!

    @Shane,
    The most certainly need to improve. Adding Pages to the search was a step in the right direction, but for larger sites, it is just a mess. Doing site: with Google, as you say, is almost always a better way to find what you’re looking for, and the same goes for Lijit. That being said, I hope the WP developers will get their heads around search for future releases.

    ( Reply )
  15. PG

    Taylor Satula August 6th

    Kool, The one thing i like in wp search is as its posted its searchable. But this is a good i dea 2

    ( Reply )
  16. PG

    lkayART May 7th

    Great tutorial, I’ll make shure to add this into my upcomming blog ;>

    ( Reply )
  17. PG

    Mr.Choice June 10th

    We have been using Lijit. It is fantastic.

    ( Reply )
  18. PG

    PhilippineOutsourcing September 27th

    nice tuts.. i love it. thanks for posting..

    ( Reply )
  1. Arrow
    Gravatar

    Your Name
    September 27th