Showing posts with label Customization. Show all posts
Showing posts with label Customization. Show all posts

Sunday, July 18, 2010

Create folder content type with metadata

Create new content type

clip_image001

Fill in name and choose Folder Content Type and Content Type “Folder” as parent

clip_image002

Assign the needed columns. In this case a status column

clip_image003

Choose add from existing content type to a document library

clip_image004

And choose new content type special folder

Afterwards you get a new column “status”

clip_image005

Now you can add a new folder with the New button for the document library

clip_image006

Now you can type the folder name and all meta data you configured. In this case the status

This is working for SharePoint 2007 and SharePoint 2010

Thursday, February 18, 2010

SharePoint List Fixed Header

The following script from

http://kjellsj.blogspot.com/2009/06/sharepoint-jquery-scrolling-view-with.html

Gives the possiblity to fix the list header for large lists.

I modified the script from Kjell-Sverre Jerijærvi to adapt to the screen height.

Please change the src link to the jQuery file and the list QUID. Both are marked with grey.

 

<script

src="Link to jquery.js"

type="text/javascript"></script>

<style type="text/css">

<!--

.DataGridFixedHeader { position: relative; top: expression (this.offsetParent.scrollTop);}

-->

</style>

<script type="text/javascript">

$(function(){

var $table = $("TABLE[ID^='{BFD03356-0ACF-4950-9C6C-D772A31E3E46}']:first",

"#MSO_ContentTable");

<!--WRAP TABLE IN SCROLL PANE-->

$table.wrap("<DIV style='OVERFLOW: auto; HEIGHT: " + (screen.height-400) + "px'></DIV>"); <!--FROZEN HEADER ROW--> $("TR.ms-viewheadertr:first", $table).addClass("DataGridFixedHeader");

});

</script>

Friday, February 12, 2010

Use you own local CSS file without admin rights

    For example if you want to change on a site or site collection some CSS format

    Like in this example the link color:

    Save this CSS setting in a file on the SharePoint site

    clip_image001

    Upload the file to SharePoint DocLib

    clip_image002

    Go to the site settings

    clip_image003

    Click on "Master page"

    clip_image004

    Choose your MyCSS.css file for an alternate CSS. And activate if needed the reset all subsites option

    clip_image005

    All CSS format with are in the MyCSS.css file will be active.

    The "Master page" menu is only visible if the publishing feature is activated.

Edit Mode for ASPX Pages

All aspx pages in SharePoint not located in the layouts directory can

be modified (edit) by extending the url

&ControlMode=Edit&DisplayMode=Design

With the command &contents=1 it is possible to delete webpart from a page.

Create a WebPartPage with no navigation

    Create WebPart Page

    clip_image001

    clip_image002

    And configure web parts

    clip_image003

    Download the WebPart Page

    clip_image004

    Upload the blank.master

    clip_image005

    Edit the ASPX File

    Change the MasterPageFile from

    "~masterurl/default.master" to

    "../_catalogs/masterpage/blank.master"

    Upload the modified ASPX file

    clip_image006

    CheckIn to master version to get rid of the error message

    clip_image007

    clip_image008

    Done

InfoPath form in a WebPart

How to create a embedded InfoPath form in a normal web part page or site. This is how it can look like:

clip_image001

Change the web.config of the web application and add this line in the section <SafeControls>

<SafeControl Assembly="Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.Office.InfoPath.Server.Controls" TypeName="*" Safe="True" />

Go to the site where you want to show the InfoPath forms and activate the site settings

clip_image002

Click on Web Parts

clip_image003

Click on New

clip_image004

Activate the InfoPath XmlFormView Assembly

clip_image005

And click on Populate Gallery

Now you can create a new site or web part page. The following example shows how to do this with webpart pages. Please keep in mind to use the link http://url/site?contents=1 to remove/deactivate the XmlFormView WebPart.

clip_image006

Create a new Page

clip_image007

Type the Title, URL an choose a Web Part Page layout to create. Open the Page and edit

clip_image008

Add a web Part

clip_image009

Add the XmlFormView WebPart

clip_image010

The WebPart is not configured. Press close

clip_image011

This is the result. This web part is not going to work. We need to add an other one but first disable this one.

In the page library select the webpart page and edit the properties

clip_image012

clip_image013

Click on "Open Web Part Page in maintenance view"

clip_image014

Select the web part and click on close

Go back to edit the web part page and add a web part

clip_image009[1]

Select the XmlFormView web part again. This time you get the following message

clip_image015

Now modify the web part

clip_image016

Open the Data Binding properties

clip_image017

You need to have a deployed InfoPath form (see XsnLocation) and you also need a library to store the edited forms (SaveLocation). Please create them before

e.g. http://alegri-intranet/sites/site0001/FormServerTemplates/Project.xsn

e.g. http://alegri-intranet/sites/site0001/Project%20Status

Press Apply

clip_image018

Now we need to delete the fist web part. Edit the page in the page library

clip_image012[1]

clip_image013[1]

Click on "Open Web Part Page in maintenance view"

clip_image019

Select the right web part and click on delete

That's it.

Broken web parts

If you added a web part and can not access your site/page anymore

or

if you closed the web part but you want to delete the web part

type after the site/page URL the parameter ?contents=1

With this maintenance page you can delete/show, hide web part.

WepPart Page with Quicklaunch

  1. Create a webpart page in SharePoint
  2. Download the ASPX File (with the “Send To” command)
  3. Edit the ASPX file with a editor
  4. Find this lines:

<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server"></asp:Content>

<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>

<asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>

  1. Delete this lines
  2. Upload the ASPX file

    It's working.

    To use this webpart page you can create a content type and bind this content type to a doc lib.

Sunday, February 7, 2010

Missing inclusion operators in Advanced Search

  1. 1. Advanced Search->Site Actions->Edit Page
  2. 2. On “Advanced Search Box” web part, Click edit -> Modify Shared Web Part”
  3. 3. Expand Properties Tab
  4. 4. In the “Properties” textbox, find <Option Name="AllowOpContains" Value="False"/> under root node. If it does not exist, create it.
  5. 5. Change value from “False” to “True”
  6. 6. Click OK
  7. 7. Click “Publish” to publish the page

clip_image001

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   

<Option Name="AllowOpContains" Value="True"/>

<LangDefs>

Saturday, February 6, 2010

Change WebPart Page - No Navigation, only Content

 

This is the complete web page

clip_image001

First create a "lite" master call blank.master

<%-- Identifies this page as a .master page written in Microsoft Visual C# and registers tag prefixes, namespaces, assemblies, and controls. --%>

<%@ 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" %>

<%-- Uses the Microsoft Office namespace and schema. --%>

<html>

<SharePoint:RobotsMetaTag runat="server"/>

<%-- The head section includes a content placeholder for the page title and links to CSS and ECMAScript (JScript, JavaScript) files that run on the 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>

<%-- When loading the body of the .master page, SharePoint Server 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. --%>

<body onload="javascript:_spBodyOnLoadWrapper();">

<%-- The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. --%>

<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">

<WebPartPages:SPWebPartManager runat="server"/>

<PublishingSiteAction:SiteActionMenu runat="server"/>

<PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server">

<PublishingConsole:Console runat="server" />

</PublishingWebControls:AuthoringContainer>

<%-- The PlaceHolderMain content placeholder defines where to place the page content for all the content from the page layout. The page layout can overwrite any content placeholder from the master page. Example: The PlaceHolderLeftNavBar can overwrite the left navigation bar. --%>

<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />

<asp:Panel visible="false" runat="server">

<%-- These ContentPlaceHolders ensure all default SharePoint Server pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. --%><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:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" /></asp:Panel>

</form>

</body>

</html>

Create a new file an call it blank.master with SharePoint Designer under

_catalogs/masterpage

clip_image002

Create a new webpart page and configure the webpart. This can be done afterwards also.

Open the webpart page in SharePoint Designer

In this example the page is called test.aspx

clip_image003

Change the master page reference for this page

clip_image004

And click on the preview window

clip_image005

Click on attach a master page

clip_image006

And select the master page blank.master

clip_image007

Click on OK

clip_image008

Click on Ok and save the modified webpart page

That's all