Posts

Showing posts from November, 2012

Display Status Indicator(Red/Green Indicators) on SharePoint List view

Image
Display Status Indicator(Red/Green Indicators) on SharePoint List view: Create a list called "Expiration Status" with below columns 1. Expiration Date - Date Time 2. Today - String  -- This needs to be deleted once the below calculated field is created. We are creating this column as the SharePoint does not allow us to use Today in Calculated field 3. Color - Calculated Column 4. Status - Calculated Column Add a Content Editor Web part to to the page and add the below script: <script type="text/javascript"> var theTDs = document.getElementsByTagName("TD"); var i=0; var TDContent = " "; while (i < theTDs.length) { try { TDContent = theTDs[i].innerText || theTDs[i].textContent; if ((TDContent.indexOf("<DIV") == 0) && (TDContent.indexOf("</DIV>") >= 0)) { theTDs[i].innerHTML = TDContent; } } catch(err){} i=i+1; }</script> Save the page then list view should look...

SharePoint Search Webparts

Image
People Search Core Results Web part I have been asked by my client to to browse/show a people directory within the organisation unit without having to enter a search query. They then want to see a list of filters such as Department or Job Title to allow them to filter the results. This is really easy to set up using the default SharePoint 2010 search web parts and doesn’t require writing a single line of code The standard search result web part does not show any results unless a query is specified. To get all people to show up by default we need to specify either a fixed keyword query or append text to the query in the People Search Core Results web part properties. If we specify a fixed keyword query the web part will always display results for the specified search query on the page regardless of whether the user has entered a search query. If we select append text to query then when the user types a query we will see results from a search query that includes both th...