<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://suguk.org/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>sharepoint.H@ck</title><link>http://suguk.org/blogs/sharepointhack/default.aspx</link><description>hacking away at SharePoint since SPS 2001</description><dc:language>en-US</dc:language><generator>CommunityServer 2.0 (Build: 60210.2610)</generator><item><title>Add a list view to a layout page</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/05/05/10419.aspx</link><pubDate>Mon, 05 May 2008 10:10:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:10419</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>0</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/10419.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=10419</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial size=1&gt;First of all, thanks to &lt;STRONG&gt;Andy Kinnear&lt;/STRONG&gt; for writing this piece of code! What this control does is to allow you to add a list view to any layout or master page :)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face=Arial size=1&gt;Notes:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;You only need to specify the name of the list (no GUID)&lt;/FONT&gt;&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;You are able to type in the name of the view you would like displayed; if you dont specify a view name it will display the default view of this list.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT size=1&gt;&amp;nbsp;&lt;/FONT&gt; 
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;The custom control will only look for the frist list name as specified it can find in the current site, or any sites above the current site if the list name is not in the current site.&lt;/FONT&gt;&lt;/SPAN&gt; 
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;You can only specify the list name and view name in master / layout page where you add the control.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;FONT size=1&gt;INSTRUCTIONS:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;Build the class:&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;using System;&lt;BR&gt;using System.ComponentModel;&lt;BR&gt;using System.Text;&lt;BR&gt;using System.Web;&lt;BR&gt;using System.Web.UI;&lt;BR&gt;using System.Web.UI.WebControls;&lt;BR&gt;using System.Web.UI.HtmlControls;&lt;BR&gt;&lt;BR&gt;using Microsoft.SharePoint.Publishing.Navigation;&lt;BR&gt;using Microsoft.SharePoint.WebControls;&lt;BR&gt;using Microsoft.SharePoint;&lt;BR&gt;using PortalCustomNav.ComponentModel;&lt;BR&gt;&lt;BR&gt;namespace PortalCustomNav.WebControls&lt;BR&gt;{&lt;BR&gt;[ToolboxData("&amp;lt;{0}:ListViewControl runat=\"server\" /&amp;gt;")]&lt;BR&gt;public class ListViewControl : SPControl&lt;BR&gt;{&lt;BR&gt;&lt;BR&gt;[Browsable(true)]&lt;BR&gt;[SPCategory("SPCategory_Configuration")]&lt;BR&gt;[DefaultValue("")]&lt;BR&gt;[SPDescription("ListControlDescription_ListName")]&lt;BR&gt;&lt;BR&gt;private string _listName = "";&lt;BR&gt;&lt;BR&gt;public string ListName&lt;BR&gt;{&lt;BR&gt;get&lt;BR&gt;{&lt;BR&gt;return _listName;&lt;BR&gt;}&lt;BR&gt;set&lt;BR&gt;{&lt;BR&gt;_listName = value;&lt;BR&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;[Browsable(true)]&lt;BR&gt;[SPCategory("SPCategory_Configuration")]&lt;BR&gt;[DefaultValue("")]&lt;BR&gt;[SPDescription("ListControlDescription_ListName")]&lt;BR&gt;&lt;BR&gt;private string _listViewName = "";&lt;BR&gt;&lt;BR&gt;public string ListViewName&lt;BR&gt;{&lt;BR&gt;get&lt;BR&gt;{&lt;BR&gt;return _listViewName;&lt;BR&gt;}&lt;BR&gt;set&lt;BR&gt;{&lt;BR&gt;_listViewName = value;&lt;BR&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;protected SPList GetCurrentList(SPWeb site)&lt;BR&gt;{&lt;BR&gt;&lt;BR&gt;SPListCollection view = site.GetListsOfType(SPBaseType.GenericList);&lt;BR&gt;&lt;BR&gt;foreach (SPList list in view)&lt;BR&gt;{&lt;BR&gt;if (list.Title == this._listName)&lt;BR&gt;{&lt;BR&gt;return list;&lt;BR&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;if (site.ParentWeb != null)&lt;BR&gt;{&lt;BR&gt;return GetCurrentList(site.ParentWeb);&lt;BR&gt;}&lt;BR&gt;return null;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;protected SPList GetCurrentList()&lt;BR&gt;{&lt;BR&gt;SPWeb site = Microsoft.SharePoint.SPContext.Current.Web;&lt;BR&gt;SPList list = GetCurrentList(site);&lt;BR&gt;return list;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;//Render the list view&lt;BR&gt;protected override void Render(HtmlTextWriter writer)&lt;BR&gt;{&lt;BR&gt;&lt;BR&gt;SPList lst = GetCurrentList();&lt;BR&gt;&lt;BR&gt;if (lst != null)&lt;BR&gt;{&lt;BR&gt;&lt;BR&gt;foreach (SPView view in lst.Views)&lt;BR&gt;{&lt;BR&gt;if (view.Title == this._listViewName)&lt;BR&gt;{&lt;BR&gt;SPQuery query = new SPQuery(view);&lt;BR&gt;writer.Write(lst.RenderAsHtml(query));&lt;BR&gt;return;&lt;BR&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;writer.Write("View " + this._listViewName + " not found in list");&lt;BR&gt;&lt;BR&gt;}&lt;BR&gt;else&lt;BR&gt;{&lt;BR&gt;writer.Write ("List "+this._listName+" not found in site or parent site");&lt;BR&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;}&lt;BR&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;&lt;SPAN&gt;Register the class in the GAC and add a "Safe Control" entry in the web.conf file.&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/SPAN&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;Register the control in the master page:&lt;BR&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;&amp;lt;%@ Register Tagprefix="PortalCustomNav" Namespace="PortalCustomNav.WebControls" Assembly="PortalCustomNav, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0c07a529847e943d" %&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;Add the control to the master page:&lt;BR&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT size=1&gt;&amp;lt;PortalCustomNav:ListViewControl runat="server" ListName="Comments" ListViewName=""&amp;gt;&amp;lt;/PortalCustomNav:ListViewControl&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=10419" width="1" height="1"&gt;</description></item><item><title>MOSS TABLES | USAGE REPORTING | Part 2</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/05/05/9230.aspx</link><pubDate>Mon, 05 May 2008 07:00:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:9230</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>1</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/9230.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=9230</wfw:commentRss><description>In "Part 1" is showed a sql query example of how you could get a rolling total of all content added to a content database on a monthly basis. Here I will show how to further filter this query to exclude records of items that may exist within the recycle bin, items which are only document related, etc. 
You may need to do this when you want to report on only documents and their versions that exist within lists and libraries, but not in Recycle Bins. Remember that once the default storage period of...(&lt;a href="http://suguk.org/blogs/sharepointhack/archive/2008/05/05/9230.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://suguk.org/aggbug.aspx?PostID=9230" width="1" height="1"&gt;</description><category domain="http://suguk.org/blogs/sharepointhack/archive/category/1009.aspx">MOSS 2007</category></item><item><title>MOSS Tables | Usage Reporting | Part 1</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/03/17/9161.aspx</link><pubDate>Mon, 17 Mar 2008 13:00:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:9161</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>5</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/9161.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=9161</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;As this is going to be an ongoing exercise I am splitting this into parts.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;At the moment I am busy finding ways to create different types of usage reports for MOSS deployments. There are some good tools out there that help with this (Reporting Framework from Codeplex) and of course the default MOSS usage reports. None of these however quite fit my or most of my clients requirements, some examples of which are:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;We want to see how many documents were added in each month with a rolling total.&lt;/FONT&gt; 
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;This must&amp;nbsp;EXCLUDE folders, lists and list items (they only want to see what has been uploaded to the system).&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Show total content on the system excluding content in the recycle bin&lt;/FONT&gt; 
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Eventually items are removed from the recycle bin and from all MOSS tables, when showing rolling totals items in the recycle bin will modify previous known figures.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Show percentage values of content type usage. (10% Agenda, 12% Minutes etc.)&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Show percentage values of file type usage (10% Word Documents, 20% PDF Documents, etc.)&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;And more....&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;I have managed to achieve all the above and more and will be addind to this post as I have time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;First things first, what tables should be used for these reporting requirements? I am using the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Alldocs&lt;BR&gt;This contains records of everything&amp;nbsp;that has been added to MOSS excluding the following:&lt;/FONT&gt; 
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Lists and Libraries&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Sites&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;AllDocStreams&lt;BR&gt;This contains records of everything that has been added to MOSS excluding the following:&lt;/FONT&gt; 
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Lists and Libraries&lt;/FONT&gt; 
&lt;LI&gt;&lt;STRONG&gt;&lt;FONT face=Verdana size=1&gt;List Items&lt;/FONT&gt;&lt;/STRONG&gt; 
&lt;LI&gt;&lt;STRONG&gt;&lt;FONT face=Verdana size=1&gt;Folders&lt;/FONT&gt;&lt;/STRONG&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Sites&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;AllUserData&lt;BR&gt;I am using this table as it contains extra information like "Content Type" and other data for items in the Alldocs and AlldocStreams tables that I need to use.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;RecycleBin&lt;BR&gt;Self explanatory.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Alllists&lt;BR&gt;I need this to get list names for some of my other reports.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Webs&lt;BR&gt;I need this to get a breakdown of content usage per site.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Example: Show how many items have been added per month with a rolling total&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#ff0000&gt;&lt;FONT size=1&gt;&lt;STRONG&gt;NOTE: &lt;/STRONG&gt;as always it is never recommended by MS that you run queries / stored procedures directly on a production DB, rather make copies of the required tables. (if you are like many of my clients who cannot afford the extra data storage, run these reports at midnight :) )&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#ff0000 size=1&gt;My SQL is rough - you have been warned :)&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;The following SQL query will get all items that have been added to the system, show how many were added per month and what each months rolling total was (usefull for a growth line):&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#d3d3d3 size=1&gt;USE {add your selected content database here}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#d3d3d3 size=1&gt;SELECT DATENAME([month], x1.monthdate) + ' ' + DATENAME([year], x1.monthdate) AS [Month and Year], MAX(x1.added) AS [Added in Month], SUM(x2.added) AS [Rolling Total]&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT face=Verdana color=#d3d3d3 size=1&gt;FROM &lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#d3d3d3&gt;&lt;FONT face=Verdana size=1&gt;(SELECT MONTH(TimeCreated) AS monthno, DATEADD([month], DATEDIFF([month], 0, TimeCreated), 0) AS monthdate, COUNT(*) AS added&amp;nbsp;&lt;/FONT&gt;&lt;FONT face=Verdana size=1&gt;FROM alldocs &lt;/FONT&gt;&lt;FONT face=Verdana size=1&gt;WHERE id IN&amp;nbsp;&amp;nbsp;(SELECT id&amp;nbsp;FROM alldocstreams)&amp;nbsp;GROUP BY DATEADD([month], DATEDIFF([month], 0, TimeCreated), 0), MONTH(TimeCreated)) AS&amp;nbsp;x1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT face=Verdana color=#d3d3d3 size=1&gt;INNER JOIN&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana size=1&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#d3d3d3&gt;&lt;FONT face=Verdana size=1&gt;(SELECT MONTH(TimeCreated) AS monthno, DATEADD([month], DATEDIFF([month], 0, TimeCreated), 0) AS monthdate, COUNT(*) AS added&amp;nbsp;&lt;/FONT&gt;&lt;FONT face=Verdana size=1&gt;FROM alldocs &lt;/FONT&gt;&lt;FONT face=Verdana size=1&gt;WHERE id IN&amp;nbsp;&amp;nbsp;(SELECT id&amp;nbsp;FROM alldocstreams)&amp;nbsp;GROUP BY DATEADD([month], DATEDIFF([month], 0, TimeCreated), 0), MONTH(TimeCreated)) AS&amp;nbsp;x2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#d3d3d3&gt;ON x1.monthdate &amp;gt;= x2.monthdate&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#d3d3d3&gt;GROUP BY x1.monthdate ORDER BY x1.monthdate&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE dir=ltr&gt;
&lt;BLOCKQUOTE dir=ltr&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; The above query returns only items that have been uploaded into the environment, to show all content remove the following WHERE queries:&lt;BR&gt;&lt;STRONG&gt;WHERE id IN (SELECT id from alldocstreams)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;The above is just a sample of the query I used which is combined in my stored procs which read off of a custom reporting database. My queries go further as they automatically find all relevant content databases and run this query....this I will not show as we all need to learn :)&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr&gt;
&lt;P dir=ltr&gt;If I had place to put screenshots I would show how the pivot tables pulled into Excel Services work.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;A HREF="/blogs/sharepointhack/archive/2008/05/05/9230.aspx"&gt;Part 2 here.&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=9161" width="1" height="1"&gt;</description></item><item><title>Customization Planning and pre-emptive steps - Food for thought?</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/03/06/8858.aspx</link><pubDate>Thu, 06 Mar 2008 11:59:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:8858</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>3</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/8858.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=8858</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;We all know the pitfalls of messing around with default MOSS files and that the basic rules are always to create and modify your own rather than the defaults. One of the main reasons for this is ongoing support for the product from MS (they wont support cusomised changes to defaukt files) as well as the impact of service packs and hotfixes (they generally overwrite default files and hence any changes you made to them).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Now in most cases we dont always know about changes we need to make, and when we do it is sometimes neccessary to change the default files as previous sites are now linked to those files; take the CORE.js and Viewpage.aspx files as examples:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;CORE.js controls things like context menus and other nice things.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Viewpage.aspx is the default page used to create list pages like "Allitems.aspx"&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Recently I needed to modify the CORE.js file to fix a problem with emailed links (some people could not open the link as it was an encoded URL), now rather than modifying the default CORE.js I made a copy and renamed it ClientCore.js, made the changes and replace the reference to the CORE.js in all my custom pages.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; Most list pages are created from the "Viewpage.aspx" page, this page has the default.master as it's master page and I do not want to mess with a MOSS default file.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt; Make a copy of the "Viewpage.aspx", change the default.master to my custom master (that references my ClientCore.js instead), change the references in my custom Document Library SCHEMA.xml to create views from the new page. There we go.&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; All previous document libraries have been created from the original file with the reference to the original Core.js. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt; None really, unless I change the default Core.js / add a the code manually to all preivous libraries. As soon as I apply a hotfix / sp the changes are going to be overwritten.&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;The real solution?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Planing, planning and paranoia: Now days I automatically ensure I make copies of the files I know / suspect will need to change and ensure that I make references to them; specifically:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Core.js&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Viewpage.aspx&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;default.master&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;(and some others)&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;What about updates?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;This is another problem with no quick-win situation: when a SP or Hotfix does come along and makes changes to the Core.js for instance that are neccessary I simply copy those changes accross into my customized file (look at the documentation, all changes are recorded).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face=Verdana size=1&gt;Conclusion:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;I know most will disagree with my methods, but when you are facing large, multi farm environments where changes / fixes need to be made after deployment this really works out easier for me. Schlep in the begining to make my life easier in the end :)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Your feedback and ideas would be appreciated on this!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=8858" width="1" height="1"&gt;</description></item><item><title>Interesting side effects when playing with content types in a library</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/02/28/8755.aspx</link><pubDate>Thu, 28 Feb 2008 14:07:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:8755</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>1</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/8755.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=8755</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;I thought I would start a page on some interseting side effects I come accross when playing with the content types in a document library feature:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Try this:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Create a document library feature and remove the content types from the &lt;FONT color=#d3d3d3&gt;schema.xml&lt;/FONT&gt; file.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Now activate the feature on a site and browse to the new document library.&lt;/FONT&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Click the "New" dropdown and you will see that a content type with the same name as your document library is available :)&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;If you create a instance of this document library that has content type bindings, then you will not have this problem.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=8755" width="1" height="1"&gt;</description></item><item><title>Attaching content types to folders</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/02/27/8712.aspx</link><pubDate>Wed, 27 Feb 2008 13:53:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:8712</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>0</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/8712.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=8712</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;This question has been asked many times: "Each folder in my document library must have a different content type, is this possible?"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;The only reason for me posting this&amp;nbsp;is that MANY people think that you are unable to associate a content type to a specific folder, when in fact you can and is very easy to do:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Add all the content types that you are going to use for each of your folders to the document library (dont panic, the users will not see all of them!).&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Create a new folder.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Open the drop-down context menu for the folder and select the "change new button order" link. (yes, it is actually this simple)&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Select the content types that should be displayed when the user is in this folder.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;NOTE: &lt;/STRONG&gt;This will not affect the content type selection on the Upload page though, users will still be able to select from all content types when uploading a document.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=8712" width="1" height="1"&gt;</description><category domain="http://suguk.org/blogs/sharepointhack/archive/category/1012.aspx">Configuration</category></item><item><title>Adding the Content Editor web part to a site template</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/02/25/8631.aspx</link><pubDate>Mon, 25 Feb 2008 17:11:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:8631</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>2</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/8631.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=8631</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Most of you probably already know this, but I thought I would post about it for those who dont. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;I have had a couple of questions from people on how to add a content editor web part to a site template (site definition) that contains custom html / javascript code as its content. They have no problem with inserting &lt;STRONG&gt;normal text&lt;/STRONG&gt; into the web part that they include in the site template, only when they add some html code.&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Lets say we want to add the following table code:&lt;BR&gt;&amp;lt;Table&amp;gt;&amp;lt;td&amp;gt;My table in the Web Part&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;The problem lies with the duplicate &amp;lt;![CDATA[ tags in the web part itself; the second one prematurely ends the first ones tag:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;The first &amp;lt;![CDATA[ tag is just after the "&amp;lt;AllUsersWebPart WebPartZoneID="Left" WebPartOrder="1"&amp;gt; tag.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;The second &amp;lt;![CDATA[ tag is just after the "&amp;lt;Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"&amp;gt;" tag.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Replace the second instance of the "&amp;lt;![CDATA[" and "]]"&amp;nbsp;tag with &amp;lt;Value&amp;gt; and &amp;lt;/Value&amp;gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;From this:&lt;BR&gt;&amp;lt;Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"&amp;gt;&lt;FONT color=#ff0000&gt;&amp;lt;![CDATA[&lt;/FONT&gt;&amp;lt;Table&amp;gt;&amp;lt;td&amp;gt;My table in the Web Part&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;FONT color=#ff0000&gt;]]&lt;/FONT&gt;&amp;lt;/Content&amp;gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;To this:&lt;BR&gt;&amp;lt;Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"&amp;gt;&lt;STRONG&gt;&lt;FONT color=#9acd32&gt;&amp;lt;Value&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;lt;Table&amp;gt;&amp;lt;td&amp;gt;My table in the Web Part&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;STRONG&gt;&lt;FONT color=#9acd32&gt;&amp;lt;/Value&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;lt;/Content&amp;gt;his:&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;The other problem lies within the format of the html / javascript tags within the &amp;lt;Content...&amp;gt;&amp;lt;/Content&amp;gt; tags:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;The "&amp;lt;" and "&amp;gt;" opening and closing brackets need to be replaced with "&amp;amp;lt;" and "&amp;amp;gt;" respectively.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;So, replace the opening and closing tags:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;From this:&lt;BR&gt;&amp;lt;Table&amp;gt;&amp;lt;td&amp;gt;My table in the Web Part&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;To this:&lt;BR&gt;&amp;amp;lt;Table&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;My table in the Web Part&amp;amp;lt;/td&amp;amp;gt;&amp;amp;lt;/table&amp;amp;gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Now your content editor webpart will work in your site template, below is the whole piece of code:&lt;BR&gt;&lt;BR&gt;&amp;lt;AllUsersWebPart WebPartZoneID="Left" WebPartOrder="1"&amp;gt;&amp;lt;![CDATA[&amp;lt;WebPart xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns="&lt;A href="http://schemas.microsoft.com/WebPart/v2"&gt;http://schemas.microsoft.com/WebPart/v2&lt;/A&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Title&amp;gt;My Table Web Part&amp;lt;/Title&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;FrameType&amp;gt;None&amp;lt;/FrameType&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Description&amp;gt;Use for formatted text, tables, and images.&amp;lt;/Description&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;IsIncluded&amp;gt;true&amp;lt;/IsIncluded&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;ZoneID&amp;gt;Left&amp;lt;/ZoneID&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;PartOrder&amp;gt;0&amp;lt;/PartOrder&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;FrameState&amp;gt;Normal&amp;lt;/FrameState&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Height /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Width /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;AllowRemove&amp;gt;true&amp;lt;/AllowRemove&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;AllowZoneChange&amp;gt;true&amp;lt;/AllowZoneChange&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;AllowMinimize&amp;gt;true&amp;lt;/AllowMinimize&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;AllowConnect&amp;gt;true&amp;lt;/AllowConnect&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;AllowEdit&amp;gt;true&amp;lt;/AllowEdit&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;AllowHide&amp;gt;true&amp;lt;/AllowHide&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;IsVisible&amp;gt;true&amp;lt;/IsVisible&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;DetailLink /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;HelpLink /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;HelpMode&amp;gt;Modeless&amp;lt;/HelpMode&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Dir&amp;gt;Default&amp;lt;/Dir&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;PartImageSmall /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;MissingAssembly&amp;gt;Cannot import this Web Part.&amp;lt;/MissingAssembly&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;PartImageLarge&amp;gt;/_layouts/images/mscontl.gif&amp;lt;/PartImageLarge&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;IsIncludedFilter /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Assembly&amp;gt;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;lt;/Assembly&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;TypeName&amp;gt;Microsoft.SharePoint.WebPartPages.ContentEditorWebPart&amp;lt;/TypeName&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;ContentLink xmlns="" /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"&amp;gt;&lt;FONT color=#9acd32&gt;&amp;lt;Value&amp;gt;&amp;amp;lt;Table&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;My table in the Web Part&amp;amp;lt;/td&amp;amp;gt;&amp;amp;lt;/table&amp;amp;gt;&amp;lt;/Value&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana size=1&gt;&amp;lt;/Content&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" /&amp;gt;&lt;BR&gt;&amp;lt;/WebPart&amp;gt;]]&amp;gt;&amp;lt;/AllUsersWebPart&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=8631" width="1" height="1"&gt;</description></item><item><title>Redeploying custom feature - you dont always need to retract the solution file</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/02/25/8623.aspx</link><pubDate>Mon, 25 Feb 2008 15:39:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:8623</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>1</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/8623.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=8623</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;The other day I needed to make a change to one of my features (added a new&amp;nbsp;site template to my custom sites feature, and changed an existing one) which I had already deployed through a solution file. Now the farm environment was quite large and I did not really want to retract the solution, remove it, add it and then redeploy it again as this was very time consuming.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;So this is what I did and it works like a charm (completely tested on my DEV environment before going to production):&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Made the change to the site template.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Added the new site template to the solution file.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Rebuilt the solution file (keeping the same solution ID)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Ran the following stsadm command on the server to remove but not retract the solution from existing sites: &lt;FONT color=#d3d3d3&gt;stsadm -o deletesolution -name "CustomSiteTemplates.wsp" -override&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;The &lt;STRONG&gt;-override &lt;/STRONG&gt;command forces the removal of the solution from the solution store without retracting it.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Ran the stsadm command to add the modified solution to the solution store.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Redeployed the solution to the Farm.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=8623" width="1" height="1"&gt;</description></item><item><title>Office documents open read-only in Internet Explorer</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/02/04/8158.aspx</link><pubDate>Mon, 04 Feb 2008 13:07:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:8158</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>1</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/8158.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=8158</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;There have been some issues with users that when they select a document link in SharePoint 2007 they do not get prompted to edit the document; instead the document opens directly in "Read Only" mode.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;This is a known issue with Office 2003 and MOSS 2007, the easiest way to fix this is to install any Office 2007 component / to modify the registry keys as outlined in this MS KB article:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.microsoft.com/kb/870853"&gt;&lt;FONT face=Verdana size=1&gt;http://support.microsoft.com/kb/870853&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=8158" width="1" height="1"&gt;</description></item><item><title>Showing and Hiding the QuickLaunch / Treeview</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/01/29/8093.aspx</link><pubDate>Tue, 29 Jan 2008 16:09:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:8093</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>1</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/8093.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=8093</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;There are a few posts out there that tell you how you can show / hide the QuickLaunch / Treeview menus, but most of them did not really work out so&amp;nbsp;well for me. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;So here is how I did it through cusomized master pages:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Open your / a default master page (obviously better to have your own) i nyour favorite editor.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Look for the &amp;lt;/HEAD&amp;gt; tag and paste the following Java Script before the closing tag:&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#d3d3d3&gt;&amp;lt;script language="javascript"&amp;gt; &lt;BR&gt;&amp;lt;!-- &lt;BR&gt;function showhide(layer_ref) { &lt;BR&gt;var state = 'block'; &lt;BR&gt;eval( "state=document.all." + layer_ref + ".style.display"); &lt;BR&gt;if (state == 'block') { &lt;BR&gt;state = 'none'; &lt;BR&gt;eval( "document.all[\"img" + layer_ref + "\"].src = \"_layouts/images/BLK_RGT.GIF\";");&lt;BR&gt;} &lt;BR&gt;else { &lt;BR&gt;state = 'block'; &lt;BR&gt;eval( "document.all[\"img" + layer_ref + "\"].src = \"_layouts/images/BLK_LEFT.GIF\";");&lt;BR&gt;} &lt;BR&gt;if (document.all) { //IS IE 4 or 5 (or 6 beta) &lt;BR&gt;eval( "document.all." + layer_ref + ".style.display = state"); &lt;BR&gt;} &lt;BR&gt;if (document.getElementById &amp;amp;&amp;amp;!document.all) { &lt;BR&gt;hza = document.getElementById(layer_ref); &lt;BR&gt;hza.style.display = state; &lt;BR&gt;} &lt;BR&gt;} &lt;BR&gt;//--&amp;gt; &lt;BR&gt;&amp;lt;/script&amp;gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;FONT color=#ffff00&gt;Basically, this script allows us to show and hide the contents of any &amp;lt;div&amp;gt; tags contained within the .master page. If you look at the script you will see that I have used default MOSS images for my "show" and "hide" functions.&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;LI&gt;&lt;FONT size=1&gt;&lt;FONT face=Verdana&gt;Next: locate the TreeView / QuickLaunch tags you wish to hide, for the purposes of this blog I am going to modify the TreeView, find the following tag:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#d3d3d3&gt;&amp;lt;div class="ms-treeviewouter"&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Add the followinf attributes: &lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#d3d3d3&gt;&amp;lt;div class="ms-treeviewouter" &lt;FONT color=#9acd32&gt;id="regionalNav" style="display:block"&lt;/FONT&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#ffff00&gt;What we are doing here is giving the TreeView an ID so we know what our action link is going to hide, and we are also specifying that we would like it to be displayed by default (change to display:none) if you wish to hide it by default.&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Next: locate the following code just above your treeview:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#d3d3d3&gt;&amp;lt;SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" id="idNavLinkSiteHierarchy" Text="&amp;lt;%$Resources:wss,treeview_header%&amp;gt;" AccessKey="&amp;lt;%$Resources:wss,quiklnch_allcontent_AK%&amp;gt;"/&amp;gt;&amp;lt;/td&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#ffff00&gt;This is the title bar of the TreeView (the one that says "Site Hierarchy").&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Next: add the following code:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#9acd32&gt;&amp;lt;td style="margin-right:0pt" width="10%"&amp;gt;&amp;lt;a id="lnkregionalNav" style="cursor:hand" onclick="showhide(&lt;FONT color=#ff0000&gt;'regionalNav'&lt;/FONT&gt;);"&amp;gt;&amp;lt;img src="_layouts/images/BLK_LEFT.GIF" name="imgregionalNav"/&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#ffff00&gt;Here we are adding a new column for the "Show" and "Hide" images and actions. Note that I have stated that I want to show&amp;nbsp;/ hide the TreeView with the ID of "regionalNav". I have also specified what image should be displayed on initial page load (if you change the display state of the treeview; be sure to change the image to the correct one!)&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Save and apply your master pages :)&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;You can do the same to any control with a div tag in your .master.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;P.S I would dump screenshots if I were able to :)&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=8093" width="1" height="1"&gt;</description></item><item><title>UPDATE: Setting the versioning options in a Document Library feature</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/01/14/7809.aspx</link><pubDate>Mon, 14 Jan 2008 17:48:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:7809</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>0</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/7809.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=7809</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Often companies have certain standards around version&amp;nbsp;which they would like maintained when users work with documents, this post explains how to specify the&amp;nbsp;document library versioning options in a document library feature.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Lets take the following scenario: A client wants all document libraries that are created to have the following settings in place:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Document library&amp;nbsp;must allow multiple content types.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Document library must force users to check the document out before changes are made.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Document library must maintain 5 Major versions of each document.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Document library must maintain 5 Minor versions of each major version.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;This is actually very easy and only requires a minor code addition :)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Lets go:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Go to your custom document library feature and open the SCHEMA.xml file (features\customFeature\doclib\schema.xml).&lt;BR&gt;&lt;BR&gt;Look for the following code:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#a9a9a9&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR&gt;&amp;lt;List xmlns:ows="Microsoft SharePoint" Title="$Resources:shareddocuments_Title;" Direction="$Resources:Direction;" Url="Shared Documents" BaseType="1"&amp;gt;&lt;BR&gt;&amp;lt;Metadata&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana size=1&gt;&lt;BR&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; The above code is taken from the default document library so yours may differ - the area where we are going to add our code is within the &amp;lt;List&amp;gt; tag.&lt;BR&gt;&lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;You want to add the following bits of code in the &amp;lt;List&amp;gt; tag:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#a9a9a9&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR&gt;&amp;lt;List xmlns:ows="Microsoft SharePoint" Title="$Resources:shareddocuments_Title;" Direction="$Resources:Direction;" Url="Shared Documents" BaseType="1" &lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#9acd32&gt;EnableContentTypes="TRUE"&lt;/FONT&gt; &lt;FONT color=#9acd32&gt;ForceCheckout="TRUE"&lt;/FONT&gt; &lt;FONT color=#9acd32&gt;EnableMinorVersions="TRUE"&lt;/FONT&gt; &lt;FONT color=#9acd32&gt;VersioningEnabled="TRUE"&lt;/FONT&gt; &lt;FONT color=#9acd32&gt;MajorVersionLimit="5"&lt;/FONT&gt; &lt;FONT color=#9acd32&gt;MajorWithMinorVersionsLimit="5"&lt;/FONT&gt; &lt;FONT color=#a9a9a9&gt;&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#ffff00&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; The code additions are pretty self explanetory!&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana size=1&gt;&lt;FONT color=#ffffff&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;&lt;FONT color=#a9a9a9&gt;&lt;/FONT&gt;Save, IISRESET (or enable your feature), create the document library.&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#ffa500&gt;&lt;STRONG&gt;IMPORTANT&lt;/STRONG&gt;: when creating the document library ensure to select "Create a version each time you edit a document" - otherwise your versioning settings will be overwritten!&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#9acd32&gt;When created automatically via template though, the&amp;nbsp;activation the settings will be in place.&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#9acd32&gt; &lt;BR&gt;&lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;View the versioning settings. Happy days :)&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Here are some more settings you can include:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;If you want to ensure that only users who have "edit" rights on documents can view draft versions of documents:&lt;BR&gt;&lt;FONT color=#9acd32&gt;DraftVersionVisibility="1" ("0" for read access)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Doug "bobthebuilder" McCusker&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana size=1&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=7809" width="1" height="1"&gt;</description></item><item><title>Adding folder structure to document library feature / site definition</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/01/14/7806.aspx</link><pubDate>Mon, 14 Jan 2008 17:02:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:7806</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>0</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/7806.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=7806</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;When creating custom Site Templates (features, definitions&amp;nbsp;- whichever you prefer), one of the things most clients want is a document library included in the Site Template with a pre-defined folder structure. So I thought I would share my solution for creating a document library with a pre-populated folder structure as it is becoming more popular as of late.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Now there are actually 3 different methods of doing this: &lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Through the ONET.XML file in your custom Site Template&amp;nbsp;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Through the manifest.xml file of your custom document library feature.&amp;nbsp;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Through the manifest.xml file of a custom document library &lt;STRONG&gt;instance&lt;/STRONG&gt; feature.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;In this post I am going to explain how to add it via option 3 (the instance feature) as this requires the least amount of code :) I am NOT going to explain how to create an list template instance feature (plenty of other posts out there).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Lets go:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Open your features manifest file (features/feature/listTemplates/featureName.xml)&lt;BR&gt;&lt;BR&gt;You should see something along the lines of:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#a9a9a9&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE dir=ltr&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;!-- _lcid="1033" _version="12.0.3820" _dal="1" --&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;!-- _LocalBinding --&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;Elements xmlns="&lt;/FONT&gt;&lt;A href="http://schemas.microsoft.com/sharepoint/"&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;http://schemas.microsoft.com/sharepoint/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;"&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;FONT color=#a9a9a9&gt;&amp;lt;ListInstance &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureId="00BFEA71-E717-4E80-AA17-D0C71B360101" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TemplateType="101"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title="Documents"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Url="&lt;FONT color=#ff0000&gt;Docs&lt;/FONT&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description="" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuickLaunchUrl="Docs/Forms/AllItems.aspx"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;/Elements&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Add the following code just before the &amp;lt;/Elements&amp;gt; tag:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#a9a9a9&gt;&amp;lt;Module Path="Folder01" Url="&lt;FONT color=#ff0000&gt;Docs&lt;/FONT&gt;\Folder" /&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;Note: The Url in the above tag begins with the url of the list instance&lt;BR&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=1&gt;Now, lets add a subfolder to the above folder:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#a9a9a9&gt;&amp;lt;Module Path="Folder01" Url="&lt;FONT color=#ff0000&gt;Docs&lt;/FONT&gt;\Folder\Sub-Folder" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;You can carry on like this for as long as you like. Once you are finished, install your feature. When you activate the feature your document library will be created with your pre-loaded folder structure in place.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Below is an example of one of mine:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;!-- _lcid="1033" _version="12.0.3820" _dal="1" --&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;!-- _LocalBinding --&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;Elements xmlns="&lt;/FONT&gt;&lt;A href="http://schemas.microsoft.com/sharepoint/"&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;http://schemas.microsoft.com/sharepoint/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;"&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;ListInstance &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureId="00BFEA71-E717-4E80-AA17-D0C71B360101" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TemplateType="101"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title="Documents"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Url="Docs"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description="" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuickLaunchUrl="Docs/Forms/AllItems.aspx"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&lt;FONT color=#9acd32&gt;&amp;lt;!-- required custom content type for this document library instance --&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&amp;lt;ContentTypeBinding ListUrl="Docs" ContentTypeId="0x010110" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&lt;FONT color=#9acd32&gt;&amp;lt;!-- Single folder no sub-folders --&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&amp;lt;Module Path="Administration" Url="Docs/Administration" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&lt;FONT color=#9acd32&gt;&amp;lt;!-- A Folder and associated sub-folders --&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits" /&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Assurance" /&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Corporate" /&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Risk"/&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Committee"/&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Fraud"/&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Information"/&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/External"/&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Internal"/&amp;gt;&lt;BR&gt;&amp;lt;Module Path="Audits" Url="Docs/Audits/Other"/&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a9a9a9 size=1&gt;&amp;lt;/Elements&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Doug "bobthebuilder" McCusker&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/P&gt;&lt;FONT face=Verdana size=1&gt;&lt;/FONT&gt;
&lt;BLOCKQUOTE dir=ltr&gt;&lt;FONT face=Verdana size=1&gt;&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=7806" width="1" height="1"&gt;</description></item><item><title>Setting the Web Part display properties for a Document Library list in a site definition</title><link>http://suguk.org/blogs/sharepointhack/archive/2008/01/10/7709.aspx</link><pubDate>Thu, 10 Jan 2008 16:27:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:7709</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>0</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/7709.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=7709</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Have you ever&amp;nbsp;tried add a list web part (like "Shared Documents") to the default landing page of your site, but seem unable to to change the title of the webpart, frame type etc. as the code differs from that of a standard web part?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Recently I had a requirement for a site template that should by default create a document library with 2 new views ("My Items" and "My Edited Items"), the landing page of the site should also display two web parts of the document library: one displaying the "My Items" view and the other the "My Edited Items" view.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;When you add a standard web part to a site template you generally have something like the following code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#808080 size=1&gt;&amp;lt;AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT face=Verdana color=#808080&gt;&amp;lt;![CDATA[&amp;lt;WebPart ... &amp;gt;&lt;BR&gt;&amp;lt;Assembly&amp;gt;...&amp;lt;/Assembly&amp;gt;&lt;BR&gt;&amp;lt;TypeName&amp;gt;...&amp;lt;/TypeName&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT face=Verdana color=#808080&gt;&lt;BR&gt;&amp;lt;Title&amp;gt;...&amp;lt;/Title&amp;gt;&lt;BR&gt;&amp;lt;FrameType&amp;gt;...&amp;lt;/FrameType&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;etc, etc, etc&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT face=Verdana color=#808080&gt;&amp;lt;/WebPart&amp;gt;]]&amp;gt;&lt;BR&gt;&amp;lt;/AllUsersWebPart&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=+0&gt;&lt;FONT face=Verdana size=1&gt;Now when you want to add a web part for a document library or list, you have to put in the following type of code:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#808080 size=1&gt;&amp;lt;View List="MyCustomDocumentLibrary" BaseViewID="13" WebPartZoneID="MiddleRight" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Simply&amp;nbsp;add the following code to the list view web part:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#808080 size=1&gt;&amp;lt;View List="MyCustomDocumentLibrary" BaseViewID="13" WebPartZoneID="MiddleLeft" &amp;gt;&lt;BR&gt;&lt;FONT color=#9acd32&gt;&amp;lt;![CDATA[&lt;BR&gt;&amp;lt;WebPart xmlns="&lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://schemas.microsoft.com/WebPart/v2"&gt;&lt;FONT face=Verdana color=#9acd32 size=1&gt;http://schemas.microsoft.com/WebPart/v2&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana color=#9acd32 size=1&gt;"&amp;gt;&lt;BR&gt;&amp;lt;Assembly&amp;gt;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;lt;/Assembly&amp;gt;&lt;BR&gt;&amp;lt;TypeName&amp;gt;Microsoft.SharePoint.WebPartPages.ListViewWebPart&amp;lt;/TypeName&amp;gt;&lt;BR&gt;&amp;lt;FrameType&amp;gt;TitleBarOnly&amp;lt;/FrameType&amp;gt;&lt;BR&gt;&amp;lt;Title&amp;gt;My Edited Documents&amp;lt;/Title&amp;gt;&lt;BR&gt;&amp;lt;Toolbar&amp;gt;None&amp;lt;/Toolbar&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face=Verdana color=#ffa500 size=1&gt;&amp;lt;!-- Add your other tag changes here --&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#9acd32&gt;&lt;FONT size=1&gt;&amp;lt;/WebPart&amp;gt;]]&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&amp;lt;/View&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I&amp;nbsp;added the&amp;nbsp;&lt;FONT color=#a9a9a9&gt;&amp;lt;![CDATA[&lt;/FONT&gt;&amp;nbsp;attributes of a standard web part into my&amp;nbsp;document library list view and ensured that the &lt;FONT color=#808080&gt;&amp;lt;TypeName&amp;gt;&lt;/FONT&gt; attribute was that of a &lt;STRONG&gt;ListViewWebPart.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;You may want to change the type of toolbar that is displayed for a document library web part (eg: summary), unfortunately I have not worked this one out yet.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=1&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT face=Verdana&gt;Doug "bobthebuilder" McCusker&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=7709" width="1" height="1"&gt;</description></item><item><title>Autosizing the TreeView according to contents</title><link>http://suguk.org/blogs/sharepointhack/archive/2007/12/06/7121.aspx</link><pubDate>Thu, 06 Dec 2007 12:52:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:7121</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>0</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/7121.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=7121</wfw:commentRss><description>&lt;P&gt;&lt;FONT size=1&gt;Long time no post, and I have plenty to post about! So lets get started with a simple one:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;You enable the tree view to be displayed on the page and the client loves it! Problem is though that the client does not like the vertical and horizontal scrollbars that are displayed as the width and height of the TreeView changes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Choose your master page where you would like to make the change and open it in your favorite editor (mine is notepad ++). &lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Look for the following tag: SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScroll" onscroll="BLOCKED SCRIPT_spRecordScrollPositions(this);" Style="overflow: auto;height: 400;width: 150;&amp;nbsp; and change it to: SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScroll" onscroll="BLOCKED SCRIPT_spRecordScrollPositions(this);" Style="overflow: auto;&lt;STRONG&gt;height: auto;width: auto&lt;/STRONG&gt;; &lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Done!&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT size=1&gt;Like I said, nice and simple and you have probably figured this out already :)&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=7121" width="1" height="1"&gt;</description><category domain="http://suguk.org/blogs/sharepointhack/archive/category/1009.aspx">MOSS 2007</category><category domain="http://suguk.org/blogs/sharepointhack/archive/category/1010.aspx">WSS 3.0</category><category domain="http://suguk.org/blogs/sharepointhack/archive/category/1012.aspx">Configuration</category></item><item><title>Simple way to add role based rules to InfoPath Web Form</title><link>http://suguk.org/blogs/sharepointhack/archive/2007/07/24/4394.aspx</link><pubDate>Tue, 24 Jul 2007 14:10:00 GMT</pubDate><guid isPermaLink="false">19180fc3-a95d-4057-992e-fee77d73db0e:4394</guid><dc:creator>bobthebuilder</dc:creator><slash:comments>3</slash:comments><comments>http://suguk.org/blogs/sharepointhack/comments/4394.aspx</comments><wfw:commentRss>http://suguk.org/blogs/sharepointhack/commentrss.aspx?PostID=4394</wfw:commentRss><description>&lt;P&gt;&lt;FONT size=1&gt;Web based InfoPath 2007 forms do not support the&amp;nbsp;&lt;STRONG&gt;Role Based Access &lt;/STRONG&gt;that is available as an InfoPath 2007 client form; so we need a work-a-round:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;STRONG&gt;Scenario:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;You create an application form that needs to be filled out and completed by various types of users:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;User A needs to fill out and submit the form by selecting a "Submit for Approval" button.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=1&gt;User B needs to approve the form by selecting and "Approve" button.&lt;/FONT&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;User A must not see "Approve" button.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Create your form.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Add an "Approve" and "Submit" button.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Add the following fields (do not include them in the form):&lt;/FONT&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;"CurrentlyLoggedInUser" (text field)&amp;nbsp;and "Profile" (text field)&lt;/FONT&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Set the default value of this field to be the fuction "CurrentUser()"&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Add a rule to the "CurrentlyLoggedInUser" field to update the value of the "Profile" field to "1" is the user contains the username of the person who is an approver. Else set the value to "0".&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Add conditional formatting to the "Approve" button to only display the button if the "Profile" field is equal to "1"&lt;/FONT&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;&lt;STRONG&gt;Note: &lt;/STRONG&gt;&lt;EM&gt;The conditional formating will not work based on the value of "CurrentlyLoggedInUser"&lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Add conditional formatting to the "Submit" button to only display the button if the "Profile" field is equal to "0"&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=1&gt;Done.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://suguk.org/aggbug.aspx?PostID=4394" width="1" height="1"&gt;</description><category domain="http://suguk.org/blogs/sharepointhack/archive/category/1009.aspx">MOSS 2007</category></item></channel></rss>