Wednesday, March 7, 2012

SharePoint 2010 Anonoymous Access and List Web Part with Custom XSLT

A SharePoint 2010 Site with Anonymous Access has a List Web Part or any web part that has custom XSLT applied, Anonymous user will get access denied. It will work fine for logged on user.

Solution:

I have a SharePoint 2010 public site and it has Anonymous Access enabled.
On the Landing page I added a List Web Part based on the custom list I created to store announcement information or Ads information. So its a "Landing Page Ads" list.

I added a Landing Page Ads list web part on the page, assigned the custom xslt url in the Miscellaneous section under XSL Link i.e. /Anything/Anything.xsl

After assigning the custom xsl link, this web part is supposed to display list items in a rotating fashion or like a carousel. It works find for the logged on user but for anonymous user it won't work, displays access denied message for that web part. Rest of the content/web parts on the page will display with no problem.

The solution which works in my case: I edited the landing page in SharePoint Designer.

After "< /datafields >" add these tags "< xsl >< /xsl >" and copy the code from Anything.xsl and paste it between "< xsl >< /xsl >"

Save the file and check your landing page with Anonymous access, it should work fine and should not display Access Denied error.

Thanks,

Thursday, February 23, 2012

SharePoint RegistrationID's

SharePoint Registration IDs reference to build Custom Actions

nvalidType = -1
GenericList = 100
DocumentLibrary = 101
Survey = 102
Links = 103
Announcements = 104
Contacts = 105
Events = 106
Tasks = 107
DiscussionBoard = 108
PictureLibrary = 109
DataSources = 110
WebTemplateCatalog = 111
UserInformation = 112
WebPartCatalog = 113
ListTemplateCatalog = 114
XMLForm = 115
MasterPageCatalog = 116
NoCodeWorkflows = 117
WorkflowProcess = 118
WebPageLibrary = 119
CustomGrid = 120
DataConnectionLibrary = 130
WorkflowHistory = 140
GanttTasks = 150
Meetings = 200
Agenda = 201
MeetingUser = 202
Decision = 204
MeetingObjective = 207
TextBox = 210
ThingsToBring = 211
HomePageLibrary = 212
Posts = 301
Comments = 302
Categories = 303
Pages = 850
IssueTracking = 1100
AdminTasks = 1200


Reference blog http://sharepointsolution2010.blogspot.com/2011/09/registration-ids-sharepoint.html

Thanks to Nandini

Monday, October 4, 2010

Implement Cascading Dropdown in SharePoint 2010 List

Implement Cascading Dropdown in SharePoint 2010 List.

To implement cascading dropdown in SharePoint list you dont need to write custom code or do customization in SharePoint Designer. All you need to do is follow below mentioned steps.Its easy!!

I will create 3 lists. Countries, Cities and CountryCity (carries cascading dropdown)

1) Countries List

Create a custom list called Countries and add some name of the countries in the list. No custom columns created. As shown in the image.



2) Cities List

Create another custom list called Cities. Add custom lookup column called Country as shown below.




Now add some items in the Cities list corresponding to the Countries mentioned in the dropdown.



3) CountryCity List

Create a custom list called CountryCity. Create two custom look up columns Country and City. I described above how to create custom column so I am not describing it again.

Cascading dropdown functionality
========================
  • Go to CountryCity List Settings then Advanced Settings. Select No in the last option 'Launch forms in a dialog'.
  • download spcd.js here
  • Upload spcd.js file in any document library on the site. This javascript file will be used to implement cascading functionality.
  • Click on 'Add new item' in the CountryCity list .
  • In this NewForm.aspx page go to 'Site Actions' then 'Edit Page'
  • Add HTML Form Web Part then 'Edit Web Part'
  • In the Source Editor, add the following code. You can download the below code from here

  • Make sure you specify the correct path of .js file (you uploaded in the doc lib) in the src attribute.
  • This is the syntax of calling the js function

var ccd1 = new cascadeDropdowns(ParentDropDownTitle, ChildDropDownTitle, Child2ParentFieldIntName, ChildListNameOrGuid, ChildLookupTargetField)

  • Hit Ok on the web part properties and stop editing NewForm.aspx page.
  • Try to add new item, Country and City dropdowns should work as cascading dropdowns.


  • You have to follow the same steps for EditForm.aspx as well.

If you have a problem implementing it, just drop a comment. It works fine in SharePoint 2007 and SharePoint 2010 both.

Thanks,

JK