Skip Navigation

The state of search

Eurekster's State of Search maps current trends in the search industry, explores the uncharted frontiers of search's future and surveys the landscape where marketing and search meet.

« Eurekster Featured On MarketWatch Today | 11 reasons to love your swicki by Bain Books »

Customizing the width of your swicki module

June 16, 2006

The swicki module consists of the search box, search button and buzz cloud that appear on your site when you drop in the Javascript/HTML code found on your swicki's (aptly named) 'Get Code for Your Site' page.

We've received the question several times via swickifeedback : "How can I adjust the width of my swicki module?" Relevant to folks wanting to drop the module into a side column thinner than the 150px we set as a default, this post tells you how.

(The sample code used below is for a column of 120px. Your specific width declarations should, of course, reflect what you need for your site.)

1. First, get the module's code. Navigate to the 'Get Code for Your Site' page for your swicki, and grab the code available there. After inserting some breaks for readibility it should look something like this:

<script type="text/javascript" src="http://swicki.eurekster.com/sidebar?groupkey=bignumber&seckey=bignumber&target=_self&numresults=20 &format=js"></script>
<noscript><font size="-1">check out the <a href="http://swickswickswack-swicki.eurekster.com">swickswickswack</a> <a href="http://swicki.eurekster.com">swicki</a> at <a href="http://www.eurekster.com">eurekster.com</a></font> </noscript>

2. Next, tweak the module code you'll be dropping into your site's pages. Add the 'layout=2' parameter to the URL's query string to tell the module to display using the narrow layout, and the 'width' parameter telling it how wide you'd like it to be, e.g. 'width=120'. Also, enclose the swicki code in a div to group the search box, search button and buzz cloud together...then set that div's CSS width to the same dimension as your column.

<div style="width:120px;">
<script type="text/javascript" src="http://swicki.eurekster.com/sidebar?groupkey=bignumber&seckey=bignumber&target=_self&numresults=20 &format=js&width=120&layout=2"> </script>
<noscript><font size="-1">check out the <a href="http://swickswickswack-swicki.eurekster.com">swickswickswack</a> <a href="http://swicki.eurekster.com">swicki</a> at <a href="http://www.eurekster.com">eurekster.com</a></font> </noscript>
</div>

3. Then, add some code to your swicki. Navigate to the 'Customize Templates' page for your swicki. In the CSS override text box, add rules to set the width of the search box, and the module container, relative to the size of your column. I've made the input box just a bit thinner for aesthetics:

input#w { width:100px; }
#swickiSearch { width: 120px; padding: 0px; }

4. Finally, drop your modified module code into your site. The swicki module should be displaying nicely within the confines of your sub-150px column. And you can continue to tweak the CSS until it's rendering as you'd like.

TrackBack

TrackBack URL for this entry:
http://www.eurekster.com/blog/cgi-bin/mt/mt-tb.cgi/81.

Comments (3)

Kei,

Thank you for the posting. I was able to create a thin swicki on one of my sites that has a sidebar under 150 pixels. I think Eureskter makes for a great site search tool and even a substitute for a site menu. Thanks again for this great web site tool.

Anastasia:

Thanks for search tool, very helpful.

Kei,

Thanks for answering my question on setting width dimensions for my Swicki; before I asked it.

Great help and a great search tool.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)