Rkapiljith's Blog
My SharePoint experiments…
Identify the Ribbon controls in SharePoint 2010 master pages
When you try for a customized master page there are serious of doubts disturbs your mind. The master page is full of delegate controls and placeholders. So identifying the ribbon control will eat our time.
So let us have a look from the v4.master.
- Open your site in SharePoint desinger 2010
- copy the v4.master and rename it as “Ribbon.master”
- Now find the word “<div id=”s4-ribbonrow” “
- This DIV is responsible for rendering the entire ribbon controls.
Snapshot of Ribbon controls from the masterpage:
If we divide our master page into two portion as header (Ribbon area) and body area. Please identify the same using the below snapshot.
So if i further subdivide and place these controls inside a table as given below …it will be more understandable for you guys.
After making these changes and publishing the master page will give us the output screen like the below snapshot.
Now we will identify the code for SiteActions button and menu.We can find this code snippet within the Ribbon control’s portion.
If we hide this SiteActions in masterpage we will get an ouput like this.
Now we will check the code for Welcome menu(Top Rightmost menu items). We can find its code snippet within the Ribbon control’s portion.
We will hide(comment) these portion using SharePoint Designer 2010.
After making these master page changes the output screen will look like this. So no more Welcome menu for our SharePoint site
Hide/remove ribbon in SharePoint 2010
Some of you did noticed the SharePoint ribbons behaviour with different access priviledge. For a user having contributor or admin rights…he need the ribbon control to process further actions. But for a user with read or restricted read the ribbon doesn’t serves any purpose. So the ribbon area will be still visible and the controls will be in a disabled state.
So for making the website a more GUI friendly by avoiding the ribbon control for those who dont have priviledge use the following snippet.
- Open your master page in SharePoint Designer
- Identify the tag which you want to hide. Here in our case “<div id=”s4-ribbonrow” “
- To hide the entrire DIV and its control wrap the entire DIV inside the below code.
<Sharepoint:SPSecurityTrimmedControl runat=”server” Permissions=”ManageWeb”>
<Here goes your entire code snippet which you want to Hide>
</SharePoint:SPSecurityTrimmedControl>
- Save the master page and publish it
Look at the various output screen:
GUI for Contributors :
GUI for Reader before change:
GUI for Reader after change:
Cheers,
Kapiljith Rajappan
SharePoint 2010 Social Tags: I Like It and Tags & Notes
You might have noticed the social tags for I Like It and Tags & Notes. If you wish to provide this delgate control on your custom master page please use one of the following code snippet.
For Large image icons:
<SharePoint:DelegateControl ControlId=”GlobalSiteLink3” Scope=”Farm” runat=”server”/>
For Small image icons:
<SharePoint:DelegateControl ControlId=”GlobalSiteLink3-mini” Scope=”Farm” runat=”server”/>
Cheers,
Kapiljith Rajappan
JQuery and SharePoint 2010
Is it an easy task for developers to include JQuery on SharePoint 2010 platform?
Yes !!!
Easy steps:
- Always download the latest version of JQuery from www.jquery.com. Hope you will find the section for download. Take the Minified version which is well optmizedd and compressed for Production rollouts.
- Now you need to upload the JQuery files either to your website’s shared library or you can place them in “14″ Hive system folder. You can do both scenario if in case JQuery files taking much time to load from website; it can download the same from “14″ Hive folder. So what is 14 folder ? This is the sytem location “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS”.So create a new folder in LAYOUTS as “JQuery” and place the downloaded file.
Similarly we will upload the file into our Style Library in SharePoint. I placed it inside another folder named as “JQuery”
- Now we have to mention these path in our master page file. Open your master page for editing using SharePoint designer. Check out the file and start adding the following code in the <head></head> section.
<script type=”text/ecmascript” src=”/Style Library/JQuery/jquery-1.7.2.min.js”></script>
<script type=”text/javascript”>
if (typeof jQuery == ‘undefined’)
{ document.write(unescape(“%3Cscript src=’/_LAYOUTS/JQuery/jquery-1.7.2.min.js’ type=’text/javascript’%3E%3C/script%3E”)); } </script>
Please note that %3E refered as “>” and %3C as “<”. Save your master page then publish and apply as master page for your active site. To ensure the scritps are added properly use the IE developer tool (Internet Explorer) or Fire Bug(Mozilla) and check for the added script files which is appearing as expected.
This is my screenshot from IE developer tool.
To learn JQuery some basic knowledge of JavaScript and the document object model (DOM) is required. Here i am demonstrating with IE developer tool to test the impact of JQuery.
- Open your IE developer tool
- Select the “Script” tab
- From the right side”Console” area append the script code $(document).ready(function() { $(“a”).click(function() { alert(“Hello Kapiljith Rajappan testing JQuery!”); }); });
- Click the “Run Script” button
- Now click any of the hyperlink in the page which will show the popup alert like the below snapshot .
Cheers,
Kapiljith Rajappan
SharePoint 2010 Themes
The way in themes in SharePoint 2010 arranged is bit different from the previous version of 2007. Now we have themes gallery where we can place theme files.These themes can be applied using the Site themes links from look and feel section of site settings page.
So how to create a custom theme. The best tool would be powerpoint. For editing you can use the tool from Microsoft (Theme Builder)
URL : http://connect.microsoft.com/ThemeBuilder/Downloads/DownloadDetails.aspx?DownloadID=17634
Say if you want to make changes to an existing theme file(Ricasso.thmx).Downlaod it from the themes gallery of Sharepoint and open the file in powerpoint. Save the file as Kapiljith.thmx, make sure the selected type is “Office Theme”
This is to make sure that the XML internal file name should match with the external name.Otherwise it would be like the below sample…
After saving using powerpoint, open the Kapiljith.thmx using “Theme builder” and make necessary changes and upload it back to Themes gallery.Apply the newly created theme from look & feel section of site settings page.
What is this Synchronous and Asynchronous event calls in sharepoint?
In SharePoint we come across many event handlers like …
Microsoft.SharePoint.SPWebEventReceiver(Event happenign at Site Level)
SiteDeleted/SiteDeleting/WebDeleted/WebDeleting/WebMoved/WebMoving
Microsoft.SharePoint.SPListEventReceiver(Event happenign at List Level)
FieldAdded/FieldAdding/FieldDeleted/FieldDeleting/FieldUpdated/FieldUpdating
Microsoft.SharePoint.SPItemEventReceiver(Event happenign at List Item Level)
ItemAdded/ItemAdding/ItemAttachmentAdded/ItemAttachmentAdding/ItemAttachmentDeleted/ItemAttachmentDeleting
So what is the difference in them? Pretty simple to understand.
- Synchronous will always ends with “ing” eg: ItemAdding/ItemUpdating
- Asynchronous will always ends with “ed” eg: ItemAdded/ItemUpdated
- Synchronous event will run at the same time before the event completes its operation. Say we are adding a value, we wish to validate that value. Using synchronous event we can validate it before its get added to the content DB.In other words these event provide us to block the execution of code.
- Asynchronous event will run only after the items get added.Say if a new item is added to the list and we need to send email notification, if its gender field is male to male@male.com else to female@female.com. The email logic can be integrated to ItemAdded event.
- Both methods reduce the performance as it need to execute the custom code from dll. So write the code logic very carefully!
R.Kapiljiths’s few words on …Bringing navigation menu for WSS/MOSS portals
FYI, there was a query you posted me for enabling the menu items for WSS/MOSS portals. PFB details with which you can accomplish the same First the menu is driven using the menu control called as , this will utilize the content DB and generate GUI menus. When we drill it to show many sublevel, which required more DB access, performance issue will come into picture. This might be the reason they disabled it purposefully in portal on WSS & MOSS. To enable the functionality you need to make changes to master pages • Default.Master page (/_catalog/masterpage/default.master in the site collection • \12\Template\Global\default.master on the file system. Check the web.config file have the following entry for section • • In master pages check the section • Set the parameter as ShowStartingNode=“True” • Make changes for settings within the < SharePoint.AspMenu / > control as required one. StaticDisplayLevels=”2″ MaximumDynamicDisplayLevels=”1″ Note: Increasing this parameter will create performance issues. Before change After change For more details read the following internet pages. http://sharingpoint.blogspot.com/2007/02/wss-v3-drop-down-menus-in-team-sites.html http://social.msdn.microsoft.com/forums/en-US/sharepointcustomization/thread/6d032478-0b6c-4308-b03f-b04e25e878fe/
rkapiljith’s few words on …IIS Worker Process/Worker Process Group/Web garden
Dependency on installing WSS/MOSS 2007 with windows 2003 server operating system and its web hosting on IIS – 6 is now familiar for us (sharepoint guys). For configuring access priviledge we will go for checking users and group from computer management menu. Here comes our group called as IIS_WPG.Yes the members/accounts of this group have the access priviledge to start and run a worker process.
When we create a web site on our IIS there will be a associated application pool. These application pool runs its own worker process to operate all request/response on that site. Worker process running in application pool is the hero which help us to differentiate from other website and helps hosting multiple sites on same machine. So when we create another site on same system using IIS Manager we can host the application pool to an existing pool or a new app: pool.If we host it on an existing app: pool two sites request/response will be operated by same worker process.Which is an overhead? At the same time a website can have multiple multiple worker process to operate all request/response of that site.This scenario is called as web garden.
Note: For checking websites/application pool through IIS manager, from windows start window>>Select Run>>Type inetmgr. The tree view display information on web sites and application pool on that system. But make sure that you already installed IIS 6.0 on your sytem for checking the same.
Learn more from below URL and share it to others…Best of lucks











































