DMS Polls module in Sitecore version 7.2

1 Comment

The Poll module from Sitecore marketplace provides an easy way to add poll functionality to your Sitecore site. https://marketplace.sitecore.net/en/Modules/Poll_Module.aspx

Unfortunately it does not work with Sitecore 7.2 which has some breaking API changes. In my last project we had a requirement related to polls functionality and I was able to fix the Polls module to make it work with Sitecore 7.2 with minor changes. This document and provided source code will be helpful for anyone who is planning to use polls feature in Sitecore version 7.2

Issues found with the current poll module:

  1. It is built on .net framework 3.5 and hence does not work with Sitecore 7.0 and above which are based on .Net framework 4.5
  2. When the polls module is added to a page, it tries to insert a css reference to the page header assuming header is a server side control. I modified the RegisterCSS method to fix the css reference issue.
  3. Also code refers to two fields PollItemCookiesRequiredField and PollItemCookiesRequiredTextField which does not have correct Ids. I had to comment these to make code work.

Steps to Fix the issue:

  1. Download and Install the Poll Module from Market place. Link here: https://marketplace.sitecore.net/en/Modules/Poll_Module.aspx
  2. Download the modified version of source code from here ( https://github.com/h-j/SitecorePollModule ) and include in your project.
  3. Add reference to the Sitecore.Modules.DMSPoll.dll to your project so that it gets deployed to the bin folder and overrides the package dll.
  4. You are all set to use Poll module in your Sitecore environment.

Let me know if you face any issue using it.

SharePoint Site templates

Leave a comment

Change Site look in couple of Clicks.. many nice template to choose from... and yes it is All HTML5...

Change Site look in couple of Clicks.. many nice template to choose from… and yes it is All HTML5…

First SharePoint 2013 App

1 Comment

First SharePoint 2013 App

SharePoint 2013 App

SharePoint 2013 forums

Leave a comment

Below mentioned forums can be used for discussions/QnA about SharePoint 2013

SharePoint 2013 Preview for IT Professionals

Use this forum to ask questions and comment about SharePoint 2013 Preview as it pertains to setup, deployment, administration, and other IT Professional issues.

SharePoint 2013 Preview for Developers

Use this forum to ask questions and comment about SharePoint 2013 Preview as it pertains to development, customization, and other Developer issues.

Developing Apps for SharePoint

Use this forum to ask questions and comment about developing apps for SharePoint 2013.

SharePoint 2010 Best Practices link

Leave a comment

Came across very useful link on SharePoint 2010 best practices:

http://social.technet.microsoft.com/wiki/contents/articles/8666.sharepoint-2010-best-practices-en-us.aspx?PageIndex=2

Error: Value does not fall within the expected range

1 Comment

Last week i was working with a list where i have more than 10 lookup fields. By Default sharepoint does not allow more than 8 lookup column to be shown in a view but you can have there columns in the list if not showing in a single view.

In my code, i was reading the 10 people picker value based on a condition using SPQUERY and then copying it to another list.
While accessing 9th lookup column, i got the error “Value does not fall within the expected range”. After investigating the problem I had found that returned list object contains only 8 lookup fields.

You will face this issue for all fields above threshhold value.

Solution:

Earlier I was using

SPListItemCollection coll = configList.GetItems(query);
if (coll.Count > 0)
{
SPListItem confiitem = coll[0];
}

Instead of using SPQUERY returned SPListitem, i used

SPListItemCollection coll = configList.GetItems(query);
if (coll.Count > 0)
{
SPListItem confiitem1 = coll[0];
SPListItem confiitem = configList.GetItemById(confiitem1.ID);
}

Strange but item returned through GetItemById allows you to access lookup column (i.e. People picker column) above threshhold value as well

Hope it will help you….

Technology Consulting

Leave a comment

A batch of Engineering graduates joined my company recently and I got opportunity to share my experiences in Technology consulting with them. It was fun.

The Slides is i used for the discussion.
technology-consulting

SharePoint current Site Collection or site URL in JavaScript

1 Comment

SharePoint current Site Collection or site URL in JavaScript

In Sandbox Solutions or Office 365, many times you need to get the URL of the current site to use in JavaScript.

With the ECMAScript Client Object Model, there are multiple ways to access the current site URL like SP.Site.get_url() for the Root site URL or SP.Web.get_serverRelativeUrl() for the relative url of the current site.

But for plain JavaScript code, there is an easier way to get the URL by using the OOB JavaScript variable L_Menu_BaseUrl which stores the URL of the current Web or the Subsite.

There are some more OOB Javascript variables which can be useful. 

L_Menu_LCID : This contains the LCID setting of the current site.

L_Menu_SiteTheme : This contains the theme name of the current site.

_spUserId : This contains the id of the current user.

Extending SharePoint 2010 with HTML5

Leave a comment

Does/Will SharePoint 2010 support HTML5?

This is one of most frequently asked questions from my audience in recent SharePoint talks. There seems to be a lot of interest in HTML5 and using it in SharePoint 2010. I gave a talk on Extending SharePoint 2010 with HTML 5 and excerpts from the same are listed below:
Depending on what you want, the answer may be quite different. Before we come to conclusion, here are some facts about current state of SharePoint 2010 and HTML5
1.    SharePoint is from family of application rendering output in XHTML 1.0 and CSS 2.1 and hence does not have built-in HTML 5 support. The Output HTML is not HTML 5.
2.    Mostly, it is up to browsers to support content rendering and same is true for SharePoint.
3.    SharePoint usages Master Pages and content rendering can be controlled through Master Page.
Considering above points,
  • If the need is to output SharePoint pages in HTML 5 that can be validated, we need to wait for future releases of SharePoint (Wave 15).
  • If you want HTML5 tags into SharePoint 2010 pages, this can be achieved by making changes to Master Page.

Changes required:
In SharePoint 2010 master pages, change the DOCTYPE to HTML5,  
Replace
<DOCTYPEhtmlPUBLIC“-//W3C//DTD XHTML 1.0 Strict//EN”http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;>”
with
“<!DOCTYPEhtml>”

Also note, by default, most SharePoint 2010 master pages have the following meta tag in them:

“<metahttp-equiv=“Content-Type”content=“text/html; charset=utf-8” />”

Delete it.

With the DOCTYPE changed and the meta tag deleted, the master pages renders as an HTML5 page

Hope it will help in finding the right answer for your scenario. 

The slides used during presentation can be found below:

Error: you do not have adequate permissions to modify this list. Changes to you data cannot be saved"

2 Comments

When using Claim based authentication with SharePoint 2010, If you try export to excel functionality on any sharepoint list, it works fine with Office (Excel) 2010 client but with Office (Excel) 2007 client, it throws “you do not have adequate permissions to modify this list. Changes to you data cannot be saved” error message.

Office 2007 does not support FBA/Claim based authentication and directly tries to log-in using your windows credentials.

Resolution: (Work-around)
1) Log into the SharePoint site using forms authentication from office 2007 client
2) Open any existing excel document from the site. If you do not have an excel file on the server, upload an excel sheet to any of the document library.
3) It will be opened in browser.
4) Use Open in excel link on the page to open it in excel.
5) open it in read only or edit mode
6) Provide credential on the log- in popup
7) Now go to the SharePoint list and try exporting the list to excel option. It will work.

Older Entries