RSS Dave on Twitter

Adding Suggestions to the Sharepoint search box : Part 2

Posted: October 28th, 2009 | Author: davecavins | Filed under: General SharePoint, SharePoint Design | Tags: , , , | No Comments »

In Part 1 of this post we used a simple javascript to display suggestions on a custom search box. After I wrote that post I was thinking it would make more sense to read the suggestions from a list instead of a JavaScript file. This post will explain how to setup the list and edit the JavaScript to read the suggestions from a list. The idea is that an administrator could manage the list and help guide users toward specific information instead of getting numerous un-related results like in those commercials for bing.

Assuming you already have the search box setup as described in Part one of this post all you will need to do is change the javascript and add some code to the page.

Setup

  • Do everything from the first post
  • Add a link to jQuery somewhere on the page.
  • Create a custom list called ‘Suggestions’. It just needs to have the default title field. Create at least one item in the list and in the title enter several comma separated words.
  • Add the code below to the page.
<script type="text/javascript” src=“http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js”></script>
<script type="text/javascript">
function GetItemsFromSP() {
    var soapEnv =
 “<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                <soapenv:Body> \
                     <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                        <listName>Suggestions</listName> \
                        <viewFields> \
                            <ViewFields> \
                               <FieldRef Name='Title' /> \
                           </ViewFields> \
                        </viewFields> \
                    </GetListItems> \
                </soapenv:Body> \
            </soapenv:Envelope>”;
       $.ajax({
        url: “_vti_bin/lists.asmx”,
        type: “POST”,
        dataType: “xml”,
        data: soapEnv,
        complete: processResult,
        contentType: “text/xml; charset=\”utf-8\”“,
        async: false
    });
}
function processResult(xData, status) {
    $(xData.responseXML).find(“z\\:row”).each(function() {
        $(“#data”).append(“” + $(this).attr(“ows_Title”) + “,”);
    });
}
</script>
<script type=“text/javascript” src=“Resources/searchfield.js”></script>
<div style=“display:none; visibility:hidden” id=“data”></div>

The code above get the items from the Suggestions list, seperates them with commas and puts them in a hidden div with an ID of data. Now we just need to edit the searchfield script to read in the information from our hidden div. To do this edit searchfield.js line 26 to call the GetItemsFromSP function and set the suggestionText variable to be equal to the contents of our hidden div. Here is the code.

/**/*/*/*/**/
	GetItemsFromSP();
	var suggestionText =  $(“#data”).html();

Test the page and make sure it works by typing the first few letters of one of the words in you list item.

Conclusion

This is very similar to Jan Tielens’ SharePoint Search-as-You-Type with jQuery solution but I wanted the search box to still be usable even if there are no suggestions. In Jan’s solution the ‘search box’ does not actually do anything when the magnifying glass is clicked. There are likely better ways to do this and if you know of one please post a comment.

Bookmark and Share
Share on Google Buzz

I saw this coming (SharePoint 2010)

Posted: October 27th, 2009 | Author: davecavins | Filed under: General SharePoint | Tags: , , | No Comments »

share-point-logoI was reading this article last week and it reminded me of a conversation I had with a developer friend of mine back when SharePoint 2007 came out. I was telling him that because of the ability to integrate so closely with Office SharePoint would end up dominating the market for collaboration tools.

SharePoint is not the only collaboration tool available and some would say it is not the best tool either. Google Wave, BaseCamp, Salesforce.com and others offer similar capabilities in some areas. As Chip Dizard of Absolute Presence points out Wave does not work well with IE but does integrate nicely with Google’s other online tools (Docs, Calendar, etc.). For open source fans and Microsoft haters there are several good options but it is hard to deny the convenience of SharePoint.

Most large organizations are already using Microsoft Office products for email and word processing so the fact that SharePoint works seamlessly with these applications makes it an obvious choice when it comes time to collaborate and share information. Even SharePoint 2003 had some integration with the Office products but Microsoft has taken things even further in SharePoint 2010. With such a fully integrated solution that most users will have to use as part of their work competitors like Google will have a tough time selling to businesses and large organizations.

For smaller organizations that don’t have the resources or the need for all of SharePoint’s features may Google Wave and other tools very useful. Larger organizations who require information security, full control  and data backups will find SharePoint quite capable. This article has more information on how the SharePoint team has worked to build SharePoint into its own platform

Bookmark and Share
Share on Google Buzz

Styling SharePoint Blog Comments: Part 2

Posted: October 16th, 2009 | Author: davecavins | Filed under: SharePoint Design | Tags: , , , | No Comments »

As promised I went ahead and styled the comment form on a standard SharePoint blog.  I wanted to make it look better than this but there are some limitations because of the way the page is coded with so many nested tables. 

Better looking comment form

Better looking comment form

I kept the styles pretty simple but this should be a good starting point for someone wanting to do something more complex.
Read the rest of this entry »

Bookmark and Share
Share on Google Buzz

Styling SharePoint Blog Comments

Posted: October 9th, 2009 | Author: davecavins | Filed under: General SharePoint, SharePoint Design | Tags: , , , | 3 Comments »

Out of the box the comments on SharePoint blogs dont look that good. 

Standard SharePoint blog comments

Standard SharePoint blog comments

 Here is a way to fix that problem. Just add this CSS to the page and things should start looking alot better. Read the rest of this entry »

Bookmark and Share
Share on Google Buzz

Are custom designs becoming obsolete?

Posted: October 5th, 2009 | Author: davecavins | Filed under: Web Design | Tags: , , | No Comments »

 Will Joomla make custom web design and creations from scratch obsolete?

I saw this question posted on LinkedIn last week and I thought it was interesting that people still think custom web designs will ever become irrelevant.

Creating functional good looking websites has become alot easier because of  CMS tools available for the novice web designer including Joomla, WordPress, MovableType, Expression Engine, Drupal and others. In terms of design sites like ThemeForest offer many cheap templates that can be slightly customized to fit specific needs.

So based on all this do you really need a custom design for your website?  My answer is it depends.

If the site is not meant to convey a specific message and the organization does not have branding requirements then using a template is fine. However in cases where a site has very specific requirements in terms of look and feel and functionality CMS tools and templates like those mentioned above are a good starting platform. To create a truly effective site in terms of design and messaging will  require custom CSS and design in order to be unique, convey the client’ s message effectively, and work with existing company logos and other branding elements. 

What does your site say about you?

From the perspective of a customer (who just happens to be a web designer)

When I see a website that uses a template and only changes out the logo and a few other graphics I think ‘this company did not care enough about me as a customer to design a site to appeal to me specifically’.  Many templates are very well designed and visually appealing but this does not mean they will convey the message or ideas that your website needs to communicate. In order to most effectively communication with site visitors the site will need to be custom designed after a careful analysis of  business goals and target customer demographics. 

Using stock templates will seems to save you time and money but the site will never really connect with its users like one that was designed for the purpose.

Bookmark and Share
Share on Google Buzz
Get Adobe Flash playerPlugin by wpburn.com wordpress themes