Posts Tagged ‘Tips’

Twenty (20) Rich Text Editors to use in your applications

July 14th, 2009 by Tobias Zimmergren

Author: Tobias Zimmergren 
URL: http://www.zimmergren.net | http://www.tozit.com

Introduction

Lately I’ve been looking around for some decent rich text editors for use in my asp.net (and SharePoint) applications.

I found this awesome article explaining 20 free rich text editors you can use, some better than others: http://www.webdesignerdepot.com/2008/12/20-excellent-free-rich-text-editors/

My favorite ones

As for which ones I would call my favorite (based on functionality, compatibility, performance and ease of deployment) – I would have to say:

Just be sure to read the license for each of the different editors. Some are GPL/LGPL, others are completely unlicensed and some uses other licensing models.

Have fun :-)

Zimmergren MOSS 2007 Tip #2: Retrieve stuff by code

April 5th, 2007 by Tobias Zimmergren

This is by no means meant to be anything other than a small tip on how to interact with the object model. If you need more information on how to interact and code with the object model, drop me a comment. But for now this is just to show you guys out there who havn’t done any coding with SharePoint, that it’s actually a piece of cake!

Start off by creating a new Visual Studio 2005 Windows Forms application.

Add the following namespaces: (Administration-namespace might not be needed depending what you want to do further from this point)

Also make sure you’ve got something in the Recyclebin that will show up when we launch our application later:

I made an interface like this, really hot:

Then just add the following simple code:

That’s all there’s too it! It’s not hard at all to interact with the object model. As you can see I’ve used the commonly used SPSite which contains the SPRecycleBinItem. From this point, you should know how to move on with this. An example, all you need to do in order to enable deletion of things in that recyclebin from your application is to use the .Delete() method of the SPRecycleBinItem called rItem in this case.

All very basic, should get you interested if nothing else!

Zimmergren MOSS 2007 Tip #1: Anonymous Access

March 18th, 2007 by Tobias Zimmergren

This is the first post I’m making in a series of small "how-to’s" and "aha!"-posts. It will be basic stuff that you often want to know, and why not write them down here instead of in a hidden document that I’ll forget about..

Today’s tip is: Enabling Annonymous Access to your site

  1. Begin by navigating to central administration (CA from now)
  2. Choose Application Management
  3. Choose Authentication Providers in the Application Security section
  4. Select the correct web application
  5. Click the Default Zone link
  6. Check Enable Anonymous Access and hit Save

From the Permissions-page in your site you can choose Settings -> Anonymous Access and from there make ajustments to what permissions anonymous access will have.

MOSS 2007: Search and Indexing

November 16th, 2006 by Tobias Zimmergren

In this post I will show you how to configure search by creating a content source that should be indexed and a search scope to limit the results when searcing. I will also show you how to customize the Search Center and adding a tab with a custom search and search results page.

I will walk you though how to set up searchscopes and content sources (such as fileshares).

We will begin by creating a content source and a search scope This will presume that youve got a network share with files and folders, e.g. the share whateversomeShare mapped against Z: on your local system.

1. Open SharePoint Central Administration and the Shared Services Provider admin site.
2. Open the Search Settings page
3. Choose the Content Sources link in the Crawl Settings section.
4. Choose New Content Source in the toolbar menu
5. Enter a name (I used "Demo Documents")
6. Choose File Shares as Content Source Type
7. Enter the start address (e.g. whateversomeShare)
8. Choose if it should include all subfolders or not under Crawl Settings
9. Set a schedule of your preference and choose to start the crawl if you want, then click OK
10. It should now look something similar to this image:

Screendump (Image broken due to SharePointBlogs.com crash )

11.

Now you need to start the crawl, if you didn’t do so when creating the content source

Creating a scope to narrow down the search results to only file shares
1. Navigate to Site Settings
2. Click on View Scopes in the Scope Settings section
3. Click Create New Scope in the toolbar and enter e.g. "File Shares" as the name and click OK
4. Note that the "Items" column states "Empty".
5. Click on the name (File Shares) to navigate to the Scope Properties and Rules page
6. Select "Empty > Add rules"
7. Select "Demo Documents" in the Content Scope and press OK to create the rule.
8. Now note that it says "New Scope – Ready after the next update (starts in n minutes)." To avoid this waitint time, go back to the Search Settings and click "Start Update Now" under the Scopes section.
9. Click the Site Settings menu at the top right of this site collection and choose Search scopes
10. Click the "Search Dropdown" display group and then check the "File Shares" scope and click OK.
11. Go to the Search Center to validate that the scope actually works and shows in the drop down

T2617 – Introduction to SharePoint 2007

October 26th, 2006 by Tobias Zimmergren

Monday through wednesday (today) I went the T2617 course held by Göran Husman, Sweden’s only MVP in sharePoint. The overall impression was great, and my thanks goes out to Göran who did a great job as the tutor.

I will in my upcoming post(s) describe some of the subjects covered, and what that really means. I will set up a MOSS 2007 labenvironment on which I’ll make some examples and try to explain some general concepts that are new for 2007.

I’ll update you guys in a couple of days.

Creating a custom Master Page for your MOSS 2007 portals and sites

September 28th, 2006 by Tobias Zimmergren

When I first started discovering Master pages I didn’t know where to start and what would be needed in order for a basic and as minimalistic master page as possible to work.
I gathered information to be able to make myself a minimal masterpage which would be the startingpoint of my upcoming customizations and changes.
At first nothing worked, and since there’s no good list of what elements and contentplaceholders are needed for a masterpage to work it had to do with a lot of “trial-and-error” until I finally had a completely working basic master page.
With the help of google and some other sites around the web I noted which placeholders showed up on every master page.
Below you will see the code for a very very basic master page, in which you can insert your own custom html-tags and assign a css-theme later to make your customizations a reality.
With this small template, you can make all your existing static designs work as a master page if you just put a little time and effort into it.
######### Page file starts here ############
<%@ Master language=”C#” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “
http://www.w3.org/TR/html4/loose.dtd“>
<%@ Import Namespace=”Microsoft.SharePoint” %>
<%@ Register Tagprefix=”SPSWC” Namespace=”Microsoft.SharePoint.Portal.WebControls” Assembly=”Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”SharePoint” Namespace=”Microsoft.SharePoint.WebControls” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”WebPartPages” Namespace=”Microsoft.SharePoint.WebPartPages” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”PublishingWebControls” Namespace=”Microsoft.SharePoint.Publishing.WebControls” Assembly=”Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”PublishingNavigation” Namespace=”Microsoft.SharePoint.Publishing.Navigation” Assembly=”Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”~/_controltemplates/Welcome.ascx” %>
<%@ Register TagPrefix=”wssuc” TagName=”DesignModeConsole” src=”~/_controltemplates/DesignModeConsole.ascx” %>
<%@ Register TagPrefix=”PublishingVariations” TagName=”VariationsLabelMenu” src=”~/_controltemplates/VariationsLabelMenu.ascx” %>
<%@ Register Tagprefix=”PublishingConsole” TagName=”Console” src=”~/_controltemplates/PublishingConsole.ascx” %>
<%@ Register TagPrefix=”PublishingSiteAction” TagName=”SiteActionMenu” src=”~/_controltemplates/PublishingActionMenu.ascx” %>
<html>
<WebPartPages:SPWebPartManager runat=”server”/>
<SharePoint:RobotsMetaTag runat=”server”/>
<head runat=”server”>
<asp:ContentPlaceHolder runat=”server” id=”head”>
<title>
<asp:ContentPlaceHolder id=”PlaceHolderPageTitle” runat=”server” />
</title>
</asp:ContentPlaceHolder>
<Sharepoint:CssLink runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderAdditionalPageHead” runat=”server” />
</head>
<body onload=”BLOCKED SCRIPT_spBodyOnLoadWrapper();”>
<form runat=”server” onsubmit=”return _spFormOnSubmitWrapper();”>
<wssuc:Welcome id=”explitLogout” runat=”server”/>
<PublishingSiteAction:SiteActionMenu runat=”server”/>
<PublishingWebControls:AuthoringContainer id=”authoringcontrols” runat=”server”>
<PublishingConsole:Console runat=”server” />
</PublishingWebControls:AuthoringContainer>
<asp:ContentPlaceHolder id=”PlaceHolderMain” runat=”server” />
<asp:Panel visible=”false” runat=”server”>
<asp:ContentPlaceHolder id=”PlaceHolderSearchArea” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderTitleBreadcrumb” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderPageTitleInTitleArea” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderLeftNavBar” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderPageImage” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderBodyLeftBorder” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderNavSpacer” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderTitleLeftBorder” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderTitleAreaSeparator” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderMiniConsole” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderCalendarNavigator” runat =”server” />
<asp:ContentPlaceHolder id=”PlaceHolderLeftActions” runat =”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderPageDescription” runat =”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderBodyAreaClass” runat =”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderTitleAreaClass” runat =”server”/>
</asp:Panel>
</form>
</body>
</html>
######### Page file ends here ############
As you can see there’s a javascript method in the body-tag called SpBodyOnLoadWrapper. This class is automatically loaded by MOSS 2007 and handles javascript calls.
SPWebPartManager is needed for functionality and events to work as desired. Also handles web part controls if I’m not mistaken.
The PlaceHolderMain placeholder is the placeholder that contains the page content and what not. Still unsure on the details about these placeholders, so bear with me will you.
The contentplaceholders within the <asp:panel>-block are nessesary to maintain full out-of-the-box functionality for pages to work with your own defined masterpage.
I hope this will guide you in the right direction as to starting with master page-customization. The possibilites are endless but time isn’t, therefore you can without any problems just copy/paste the above code and it should work wonders right away.