 | | Select a View |  | | |  |
| Actions |
 |
| |
| |
| |
| | |
 |  |
| Frequently Asked Questions about SharePointâ„¢ Team Services (brought to you by Mike Walsh, Helsinki, Finland). |
 |
 |  Q : 1. - What are the main skills I need to customize an STS web site? (1) |
 |
When you first start customizing you should use the User Interface provided by STS. With this you can change the document libraries visible on the home page; add document libraries; add fields (columns) to document libraries; provide views of document libraries etc.
For the next level of customizing you will need to amend the html files used in the site itself. For this you can use Notepad; HTML editors etc. and also FrontPage. For some amendments FrontPage is advantageous (and perhaps necessary).
Similar tools are needed to amend the files in the template section. Amendments here will affect all sites created later and therefore amendments to the template files need to be done with great care (with copies made etc.). Be 100% sure you know what you are doing before amending these files !
Finally, the template section also includes XML files. When amending these it is useful to use an XML Editor. This is even more dangerous than amending normal template (html) files, so amend these only when really necessary. Note that the use of FP and Notepad is not recommended for XML files - Notepad has been reported as adding code at the beginning of the .xml file that can cause problems.
Probably the best (if you can get hold of a cheap back version; or afford the latest version) editor for XML files is "XML Spy" but people have also reported using Textpad successfully. |
|
 |
 Q : 10.1 - How do I give my PDF files a different icon ? (1) |
 |
a) Go to X:\Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml
Amend DOCICON.XML by adding a new <Mapping Key="pdf" Value="icpdf.gif"/> clause where icpdf.gif is the icon you want to use for PDF files (standard is icgen.gif"/>
b) Go to X:\Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\Images and add an icon called icpdf.gif.
d) Restart IIS.
If you stop at this, this change applies to all sites and sub-webs created *after* this change has been made.
However you can add a step c) (!) to apply the change to old document libraries. (Thanks to Tom Williams for this)
c.1) Go to the _layouts\images folder typically at wwwroot (i.e. at the web site itself NOT the template section) and add the gifs there.
c.2) Repeat for all subwebs and other sites on this server (and their subwebs)
Note that if you don't do c.2 you will get an unsightly "icon is missing" in a little box which does not look good. So do all your sites/subwebs at the same time.
Finally in order to get the new icon to also appear in the listing produced by the search engine you need to do the following (Thanks to the sharepointtips site for this one)
1. Open the search.htx file under \..\wwwroot\_layout\search.htx with notepad
2. Scroll to the following lines:
function showGif(url, fName) { var L_DocImageAlt_Text = "Icon"; sExtension = fName.substring(fName.length-4,fName.length); switch (sExtension.toLowerCase()) {
3. Create a new entry just below those lines like in the following example:
case ".<file extension eg. .pdf>": gifPath="<Filename>.gif"; break;
4. Save the search.htx file " |
|
 |
 Q : 10.2 - Where do I get icons for .pdf and other file types ? (1) |
 |
| The STS Tips site at http://www.sharepointtips.com/ has a zip file containing icons for pdf, windows media (wma/wmv) and zip files along with many other icons for other file types. |
|
 |
 Q : 11.1 - How do I remove Site settings from the menu bar ? (1) |
 |
In order to do this for one site or one sub-web, go into the default.htm and amend the html code.
In order to do this for all future sites and sub-webs do the following (make a copy of ONET.XML first !)
Modify the file ONET.XML in the folder C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\50\Templates\1033\xml.
Remove the TopMenuItem corresponding to Site Settings from it.
<TopMenuItem Name="SiteSettings" DisplayName="Site Settings" Url="_layouts/settings.htm">
<!-- _locID@DisplayName="camlionet7" _locComment=" " -->
</TopMenuItem>
See IV.1 for suitable editors for XML files. |
|
 |
 Q : 11.2 - How do I remove the top level navigation across all pages ? (1) |
 |
Rather than manually removing them from every page, just hide them...
Open _layouts/styles/ows.css in notepad. Scroll down to the entry for .ms-bannerframe and add the line display: none; before the closing }
The nav bar will still be there (in the HTML), and you will still see it in FrontPage, but the browser will not display it and will reclaim the space it occupies.
(Thanks to 'Joe Admin' i.e Jim for this text).
It was confirmed that this works in both IE and Netscape.
|
|
 |
 Q : 12. - How do I create a different template for Word documents ? (1) |
 |
This is how to do this for a single document library.
a) Access the document library
b) Modify Settings and Columns
c) Change General Settings
d) Amend the Template URL
At this point you'll discover you don't have an alternative template ready ...
e) Access via My Network Places the Document Library's Forms folder and open the present template
f) Amend it and Save As <new_template_name.htm> to the same location
and repeat d).
As usual this only applies to future documents and only to document libraries where this change has been made.
|
|
 |
 Q : 13.1 - How do I get my documents to open by default in a new window ? (1) |
 |
In the template section (see FAQ1 II.3 for where this is) change the onet.xml.
1. Search for LinkFilename
2 Under the DisplayPattern tag change ...A HREF= TO ...A target="_blank" HREF=
or
3. Under the DisplayPattern tag change ...A HREF= TO ...A target="<any-name>" HREF=
Using the code in 2. will open a new window every time you click on a document. Using the code in 3. will open a new window the first time you click on a document but will then use this same window for each (different) document you open.
In other words if you don't close any documents, after having opened n documents, using the 2. code you will have 1+n windows open and using the 3. code you will have 2 windows open.
Dustin suggests that you use _newDoc as your <any-name> for ease of understanding.
As always whichever of these changes you make will only be valid for future webs and subwebs that use this template.
|
|
 |
 Q : 13.2 - How do I get my Word docs/Excel files in STS to open by default in Word/Excel rather than in the browser ? (1) |
 |
This change is a workstation change not an STS change. It has the advantage over the change in IV.13.1 that it doesn't only work for webs/subwebs created following the change. It has the disadvantage that it needs to be done on every workstation that wants it.
1. Open a copy of Windows Explorer 2. Select Tools / Folder Options 3. Select File Types 4. Select .DOC and click on Advanced 5. Remove the check mark in "Browse in same window" 6. OK etc.
Repeat if required for Excel, PowerPoint etc. files. (In my case .pdf files were already set to open in a copy of Acrobat Reader rather than in the browser) |
|
 |
 Q : 14. - How do I create a field where the Title is linked to the document ? (1) |
 |
This is covered in Example 6 of the STS SDK. The code there is fine and it works, however if you don't want to lose the little .gif marked "New" that appears in the default version until midnight on the top-level page (default.htm), then you'll need to add the following (or similar) code.
<IfNew> <HTML><![CDATA[<IMG SRC="]]></HTML> <ImagesPath/><HTML><![CDATA[newlink.gif" alt="]]></HTML> <HTML>New</HTML><HTML><![CDATA[">]]></HTML> </IfNew>
before the final
</DisplayPattern> </Field>
|
|
 |
 Q : 15.1 - Where can I buy some FrontPage themes I could use in STS ? (1) |
 |
At http://www.frontlook.com/
According to Dustin Miller "their templates and theme packs are pretty darn nice, and they work well with SharePoint Team Services". |
|
 |
 Q : 15.2 - What if I want to amend Themes myself ? (1) |
 |
When you apply a theme to an STS website, the OWS.CSS is not the only file to be modified. If you look in your subweb directory, you will see a \_themes\ directory has been added with a subfolder of the theme you created.
The 1998 MSDN article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvid/html/msdn_vidnavbr.asp
has a lot of useful information.
In particular look at the following sections of this article
Color0.css - http://msdn.microsoft.com/library/en-us/dnvid/html/msdn_vidnavbr.asp?frame=true#navbarcolor0_css
Custom.css - http://msdn.microsoft.com/library/en-us/dnvid/html/msdn_vidnavbr.asp?frame=true#navbarcustom_css
Graph0.css - http://msdn.microsoft.com/library/en-us/dnvid/html/msdn_vidnavbr.asp?frame=true#navbargraph0_css
Theme.css - http://msdn.microsoft.com/library/en-us/dnvid/html/msdn_vidnavbr.asp?frame=true#navbartheme_css
which are descriptions of the four relevant .css files.
(Thanks to "Mark" for this. |
|
 |
 Q : 16. - How do I use the 'Hyperlink or Picture' field type to make a thumbnail gallery? (1) |
 |
This involves changes to the site templates and the pages used when creating and editing a column definition, but it IS possible.
Add a new 'ImageLink' choice in the 'Format URL as' dropdown box on the new/edit column definition pages, and modify the FLDTYPES.XML file to display the new format.
Full Details follow -
Upon completion, when defining/editing a column of type 'Hyperlink or Picture', a new option is given in the 'Format URL as' dropdown. The new format is ImageLink and if selected, the field will be rendered as an image typed in the description box linking to a URL (using the Web Address specified).
In the files _layouts/FLDNEW.HTM and layouts/FLDEDIT.HTM, scroll down and find the <Case> entry for URL:
<Case ExpandXML="TRUE" Value="URL">
<HTML><![CDATA[
<!-- URL -->
Here is where the 'Format URL as' dropdown is created and the format is (somehow) set. You will see two webbots that make the entries in the dropdown. Add a third webbot by copying the second one and changing every instance of the word Image to ImageLink and the word Picture to ImageLink. Listing 1 is the complete webbot (my formatting, it's one line in the file).
Remember to make these changes to BOTH _layouts/FLDNEW.HTM and _layouts/FLDEDIT.HTM. Make these changes in any (sub) web to make this format available in existing webs. If you make these changes to the SharePoint Templates, any new webs will have this new format option.
The next step is to modify the DisplayPattern for the URL field type to check for the ImageLink Format. In the SharePoint Templates XML folder, open FLDTYPES.XML in NotePad and scroll down to the field definition for the URL data type:
<Row> <Field Name="TypeName" DisplayName="TypeName">URL</Field>
Listing 2 shows the complete code for the <Switch> tag that checks for the "Format"
Be sure to restart IIS after making these changes so the cache is cleared and it uses your new FLDTYPES.XML.
Instructions for use and a sample list using this customization are available at http://www.collutions.com/Lists/ImageGallery/
As usual, be sure to make back-up copies of any files before you modify them.
<!-- Listing 1 --> <!--webbot bot="ListMiscXML" ID="webbot10" clientside PREVIEW="List XML - Do not remove" tag="TBODY" startspan -->
<OPTION value="ImageLink" id="onetidImageLink"> <LocID value="ImageLink" id="onetidImageLink">ImageLink</LocID> </OPTION><!--webbot bot="ListMiscXML" endspan -->
<!-- Listing 2 --> <Switch> <Expr><Property Select="Format"/></Expr> <Case Value="Image"> <HTML><![CDATA[ <IMG SRC="]]> </HTML> <Column HTMLEncode="TRUE"/> <HTML> " ALT="</HTML> <Column2 HTMLEncode="TRUE"/> <HTML><![CDATA[">]]></HTML> </Case> <Case Value="ImageLink"> <HTML><![CDATA[<A HREF=" ]]></HTML> <Column HTMLEncode="TRUE"/> <HTML><![CDATA[ ">]]></HTML> <HTML><![CDATA[<IMG SRC="]]></HTML> <Column2 HTMLEncode="TRUE"/> <HTML>" ALT="Click here to goto </HTML> <Column HTMLEncode="TRUE"/> <HTML><![CDATA[">]]></HTML> </Case> <Default> <HTML><![CDATA[<A HREF="]]></HTML> <Column HTMLEncode="TRUE"/> <HTML><![CDATA[">]]></HTML> <Switch> <Expr><Column2/></Expr> <Case Value=""> <Column HTMLEncode="TRUE"/> </Case> <Default> <Column2 HTMLEncode="TRUE"/> </Default> </Switch> <HTML><![CDATA[</A>]]></HTML> </Default> </Switch>
|
| http://www.collutions.com/Lists/ImageGallery/ |
 |
 Q : 17. - How do I remove the 'new document' feature from Document Libraries? (1) |
 |
If you have access to the database, you can edit the entry for the view in the Views table. The XML used to generate the view is in the tp_view column and this is what you'll want to edit.
Copy the entire contents of the tp_view column for the view in question and paste it into your favorite text or XML editor.
Find the section <Toolbar type="Standard">
Change Standard to FreeForm
After that tag is <HTML><![CDATA[
Leave that, but delete everything from the following <SCRIPT> tag all the way down to the closing </SCRIPT> tag (inclusive) that comes just before <!-- toolbar -->
Leave the <!-- toolbar --> <TABLE> and <TR> tags, but delete the first two <TD> tags of the table (and their contents). Replace the contents of the tp_view field with your new code.
For a standard All Documents view, the new <Toolbar> code will start like this:
<Toolbar Type="FreeForm"> <HTML><![CDATA[ <!-- Toolbar --> <TABLE width=100% cellpadding=2 cellspacing=0 border=0> <TR> <td class="ms-toolbar" nowrap> <a tabindex=2 ID=diidIOUploadItem class="ms-toolbar" ACCESSKEY=U href="]]></HTML> <URL Cmd="New"/> <HTML><![CDATA[" onclick="javascript:NewItem(']]></HTML>
(Another bit of magic from Jim Duncan) |
|
 |
 Q : 18. - How do I change the text sent by an Event so that it shows which subweb it came from? (1) |
 |
Open up the event.ics file in NotePad. This file can be found in the folder where the list resides (Lists/Events) and also in the Layouts/Events folder in the Templates.
Find the SUMMARY; line and modify it as follows:
SUMMARY;ENCODING=8BIT;CHARSET=UTF8:<ows:Escape EscapeChar="\" EscapeChars="\;,"><ows:ProjectProperty Select="Title"/><osw:HTML> - </ows:HTML><ows:Column Name="Title" /></ows:Escape>
(should be one line with no breaks)
By adding <ows:ProjectProperty Select="Title"/><osw:HTML> - </ows:HTML>, the Site Name of the {sub}web will be prepended to the Calendar Item in Outlook.
(Yet another magic potion from Jim Duncan) |
|
 |
 Q : 19. - How do I make the page title equal to the "Site Name"? (1) |
 |
Add the following code to the body of each page. <script language=javascript> <!-- top.document.title='<ows:ProjectProperty> Select="Title"/> - ' + top.document.title //--> </script>
Thanks to Jeffrey Cain for this.
|
|
 |
 Q : 2. - How do I customize using Front Page? (1) |
 |
It is very important that if you use FrontPage to amend a web page (for instance the start page default.thm) that you do it the correct way.
The correct way is to start Front Page and then "Open Web". This will take you to "My Network Places" where you either have; or can set up a link to your web site. Open this web site then navigate through this until you get to default.htm. (You'll Open the Web Site then click on Folders).
Then make amendments to default.htm and save.
The incorrect way is to access the default.htm page via File Open. Changes made to default.htm will often mean that the page is not opened correctly on your Web site (usually corrected by using the User Interface to amend the default.htm file (II.5.1.). Trying to amend the file this way is no easier than the right way and causes you grief. Don't do it ! |
|
 |
 Q : 20. - How can I add the user's User Name to the default page (and let them edit their userinfo including password) ? (1) |
 |
The following code can be used as part of a welcome to users just above the QuickLaunch bar:
You are signed in as:<br /> <div style="text-align:center"> <ows:xml> <SetList Name="UserInfo" /> <View> <Query> <Where> <Eq> <FieldRef Name="ID"/> <Value Type="Text"><UserID /></Value> </Eq> </Where> </Query> <ViewFields><FieldRef Name="Title" /></ViewFields> <ViewBody><Fields><Field /></Fields></ViewBody> </View> <HTML><![CDATA[<br /><A HREF="_layouts/UserDisp.htm?ID=]]></HTML> <UserID /> <HTML><![CDATA[" style="font-size:8pt">(Edit my information)</A>]]></HTML> </ows:xml> </div>
This both identifies their User Name and gives them the desired link to edit their user info, including password.
(Thanks to Joe Friberg for this) |
|
 |
 Q : 3. - What can I sensibly customize using Front Page? (1) |
 |
| You can move the SharePoint logo file from the links section to the heading section (leaves more room in the Links column); add your own graphics; change the name from "Home" to something else; amend the width of the columns; sort the quick links; change the fields visible on the default page for the document libraries. Most of these are easy to do there follow a couple of the more difficult changes. |
|
 |
 Q : 3.1 - How do I change the fields visible in a document library? (1) |
 |
Open the web and then the default.htm in FrontPage.
Select the document library you want to change and then right-click Choose 'Layout Customization View'
Select the field you want to replace (note that the first row is the title (description) row; the second the data row. I.e. to change the field and change its heading you need to replace both)
Select the field name and then right-click. Select list field and choose a new field. Click OK.
When you've finished your changes Save and Exit. DO NOT choose "Live Data View" as this will remove all your changes. |
|
 |
 Q : 3.2 - How do I remove the time (but keep the date) from the Modified (or Created) field listed on the default page? (1) |
 |
For that document library create a new field called Modified_Date and define it as being 'Date and Time'; then "Date Only" and finally define it as having a default value 'today's date'.
Every document added to the library will now include this field with the date already completed.
Follow IV.3.1 to change the field visible from Modified to Modified_Date (you don't need to amend the title). |
|
 |
 Q : 4. - How can I add a Quick Launch link to a Sub Web ? (1) |
 |
The easiest way that I have found to do this is to amend the main default.htm by the replacement of the words "Quick Launch" by a normal html link to the Sub Web's default.htm followed by a line to split this off from the Quick Launch links.
I then add in the same place on the default.htm of the SubWeb a link to the home default.htm.
Note that adding a Link with FrontPage's "Add a Link" does not work.
See the Microsoft article
http://support.microsoft.com/default.aspx?scid=kb;us;Q275295
for more on this FrontPage problem.
(Thanks to Tom Williams for supplying the address to the KB article.) |
|
 |
 Q : 5. - What can I sensibly customize in the Template section ? (1) |
 |
You can create a new ready-made form for creation of a Document Library where Title is already the default and where there already are two existing fields called Category and Source which are filled with possible names.
Most of this is covered in a couple of the Examples in the STS SDK all of which you are recommended to look at.
Note: The SDK is over 300 pages long and most of it is full of detail that is hard to follow. The examples are however easy and can also be used as ideas for similar amendments.
|
|
 |
 Q : 6. - How can I add in my existing .asp (.php) code ? (1) |
 |
The only way to do this is to use an IFRAME clause.
This is because the code on your web site can not be processed by two conflicting methods (the front page processor or the asp (or php etc.) processor.
Within the IFRAME clause the code is processed by the correct processor (i.e. .asp or .php etc.) |
| http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/IFRAME.asp |
 |
 Q : 7. - How do I change the styles used by the STS site ? (1) |
 |
The style sheet template is the Ows.css file.
Microsoft have in the Knowledge Base a detailed explanation of how to do this - both on a site-by-site basis and on a template (i.e. affects all future sites) basis.
|
| http://support.microsoft.com/default.aspx?scid=kb;en-us;Q293332 |
 |
 Q : 8. - How do I make Title a compulsory field for all new document libraries ? (1) |
 |
Title is a field that is present in the delivered version of STS. As standard it is non-compulsory. If you, like me, think this is madness, here's how to set up your site so that Title is always be default compulsory.
Find the template file ONET.XML (follow the usual precautions - i.e. make a copy).
In the BaseType Title="Document Library" section, amend the Field with ColName="tp_Title" so that ShowInNewForm="TRUE" (was FALSE) and by adding Required="TRUE".
All future document libraries based on that template will have Title as a compulsory and visible field when you upload a document. |
|
 |
 Q : 9.1 - How do I create a new Document Library type which includes Source and a list of possible values for Source ? (1) |
 |
(If you have fields like Category and Source that you add to every library with almost the same list of values every time, it is much simpler to create a ready-made Document Library that already has these fields and values assigned)
Work your way down in the template part of your site to X:\Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\Layouts Copy the standard document library and re-name it.
Amend the SCHEMA.XML file in your new library by adding code similar to the following in the Metadata Fields part of the file (at the top).
<Field Type="Choice" BaseType="Text" Name="Source" DisplayName="Source" Required="TRUE" Description="Specify the Source"> <CHOICES> <CHOICE>Compaq</CHOICE> <CHOICE>IBM</CHOICE> <CHOICE>Microsoft</CHOICE> </CHOICES> </Field>
The CHOICES/CHOICE clause (must be capitals !) is the list of values. The Field Clause specifies the field name Source and makes it compulsory.
Then go to X:\Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml and amend ONET.XML by adding another entry to the ListTemplates Section with your new name and a new type number.
For more details of this look at Example 5 in the STS SDK (if printed ca. page 57/58 of 368).
The above solution is based on Example 5 but goes further by making the field a "Choice" field and by adding the list of possible values. Note that the SDK (elsewhere) incorrectly says that the code for a Choice field is "<Choice>" which does not work. |
|
 |
 Q : 9.2 - How do I create an additional view that automatically gets created as part of a new document library type ? (1) |
 |
Warning: This is rocket science supplied by Dave Siracusa.
1. First identify all the views in schema.xml, they are organized like this: <views> <view ...></view ...> <view ...></view ...> ... </views>
2. Copy one of the views associated with a htm file and change some of the attributes in the view tag <View BaseViewID="5" Type="HTML" Name="{2BD91CB4-0842-4803-B147-B3096CF7566B}"
<== generate a unique guid - use MS guidgen.exe (comes with <== Developer Studio)
DisplayName="Navigation" <== A new name Url="Forms/Navigation.htm" <== associate with a htm which you have to put in the template directory. Hidden="False" ModifyVversion="5.0.0.2309">
3. Copy allitems.htm to Navigation.htm in the template directory.
Note: This new view will appear in the left bar automatically when the Views are enumerated.
4. If you need to add fields to your schema do it between the <Fields> tags: <MetaData> <Fields> <Field Type="Lookup" List="UserInfo" Name="Reviewer" <== a new field DisplayName="Reviewer"> <!-- _locID@DisplayName="camlidT4" _locComment=" " --> </Field> </Fields>
You can also define global hidden fields at the onet.xml level, and then modify the field attribute to make them visible, and required if need be (for an example look at schema.xml in the favorites teamples).
5. If you want to show/hide fields within your view, find the <ViewFields> tag, add or remove from this section. <ViewFields> <FieldRef Name="DocIcon"></FieldRef> <FieldRef Name="LinkFilename"></FieldRef> <FieldRef Name="Last_x0020_Modified"></FieldRef> <FieldRef Name="Editor"></FieldRef> <FieldRef Name="Reviewer"></FieldRef> <== now show the new field we added </ViewFields>
Dave wishes you all luck !
|
|
 |
|
|
|
|
|