CQWP (Content Query Web Part) Display all fields + values
Moved from old blogging site
Below is the code which I use frequently for my XSL development in CQWP. This xsl code gets all the data and values, this helps you identify all the data before you move on with visual html development. Initially I used this custom xslt to display all the field names in Content Query Web part. I modified it to see values along with field name. Its simple needs no explanation.
<xsl:template name="AllFields" match="Row[@Style='AllFields']" mode="itemstyle"> <xsl:param name="CurPos"/> <xsl:variable name="SafeLinkUrl"> <xsl:call-template name="OuterTemplate.GetSafeLink"> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="SafeImageUrl"> <xsl:call-template name="OuterTemplate.GetSafeStaticUrl"> <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="DisplayTitle"> <xsl:call-template name="OuterTemplate.GetTitle"> <xsl:with-param name="Title" select="@Title"/> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="LinkTarget"> <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if> </xsl:variable> <div id="linkitem" class="item"> <xsl:for-each select="@*"> <span style ="font:bold"> <xsl:value-of select="name()" /> </span> : <xsl:value-of select="."/> <br/> </xsl:for-each> </div> </xsl:template> <p> </p>
——————————————
Zune 4.0 Marketplace (slowness) fix
This is a fix for slow Zune marketplace on Win 7, I have tested this on my Win 7 64 bit. Marketplace works fine on my Vista 32 bit and xp 32 bit. You can try this for your Vista 64 bit too. You can find users reporting on this forum http://forums.zune.net/2/8/526815/ShowPost.aspx
The Fix
Turn off Automatically detect LAN settings in your IE.
Steps
- Open IE
- Click on Tools–> Internet Options
- Click on “Connections” Tab
- Click button “Lan Settings”
- Un-Check ” Automatically detect settings” (this is/was set by default in my Win 7 installation)
- Restart IE and Zune (if you had it open)
I found an article for slow saving of documents in SharePoint from Windows 7 client and this was the fix and thought these were related.
Screenshots
Masking SharePoint Created By and Modified By( Making list Anonymous)
Note: This is for SharePoint environment not configured for anonymous users, usually intranet environment.
Scenario: I have had few request coming where users ask for an Anonymous feature for discussion board or custom list. Few solutions I came across were all around custom Input form and restrictive access to users and hidden views. All of the above seems doable, but I doubt all scenarios are covered for instance RSS Feeds and Web service calls.
OOB SharePoint has a functionality for Survey list which "Show user names in survey results? " which basically in OM is SPlist.ShowUser = boolean value which is available for all SharePoint list but does it function as expected, Answer is yes.
I decided update my previous Client Tool, Show-Hide fields, which uses web services to Hide List Fields on different Form Pages, it made sense to add additional functionality of Masking User names as well.
It works exactly the same but has an additional Check box for Masking User Information thus. On how to use the tool check the link here http://spyralout.com/releasestoolscode/moss-showhide-fields-using-web-services/
Below are screenshots for Masking User Info
List
Tool :
Click Update and Result
Download Link :
http://spiralout.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22305
Extending SPFF
Paul Grenier has created a wonderful script SPFF for manipulating Sharepoint form fields from URL. I have used javascript for field data manipulations a lot and his script makes it a breeze to implement. The fact that he has covered various forms of OOB fields is by itself worth having this as part of your toolbox.
You can download and read (extensive) documentation from codeplex http://spff.codeplex.com/
Extending SPFF:
Why?
I like URL based field manipulation, but it is not always enough and why just stick to one point of entry. If you are an user using Javascript for form manipulation you already hands on and wouldnt mind going crazy with the whole implementation script based implementation.
What:
1. There is a fix which lets you hide and set values for the fields from URL.
2. Now you can call these operation from your own Javascript code.
Download It is still uploaded as a path and waiting for approval.
E.g:
Setting values based on Drop Down values. We will use OOB task list.
In this example when a user selects “Status” as completed it will automatically set the percentage field to “100%”
Steps:
1. Follow instruction on how to load this Javascript and adding Content Editor to New/ Edit Form pagefrom Pauls codeplex page.
2. In Content Editor Source Editor Add the code below
<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("modifyflds");
function modifyflds()
{
$("select[title^=Status]").bind("change",statusChange);
}
function statusChange()
{
var Selected =$("select[title^=Status]").val() ;
if(Selected=="Completed")
$.spff({field:'% Complete',value:'100',lock:true});
}
</script>
In the code above we are adding an “on Change” event handler on “Status” field. In the function we check if the field is completed using SPFF we set % Complete to 100%
Adding SharePoint Search plug-in for Firefox
If you use Firefox search plugin and want to add your SharePoint intranet as part of the Firefox Search drop down, follow the steps below
First the screen shots of what we trying to accomplish
1. first create a blank xml file
2. Copy the text below and replace “sharepointurl.com” with your sharepoint url
<searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"><shortname>Sharepoint</shortname> <description>Search Internal Site.</description> <inputencoding>utf-8</inputencoding> <img height="16" width="16" />data:image/x-icon;base64,R0lGODlhMAAwAPcAANHORjF5xrtGJ5qWJtxlIyRZqhdYs8hGF8rZvXNxK7u0FChTmmfLZnPcc8jU6oHsgeHdM3zrfOiFRLfH5Cpzw8G7FXGZOeN6N6g5Jf39/ae73XDjcPH1+mvha9fbzB1SpY2LTvmZQ+vHwlrVWpPykozxjBthudVoNujmQ9NYHry6m2e6XvL48eXiKqmjL9iTiszlx9deIiNtwWTdZbi9pDlpsunmNdvs1xREmcnDLLbZrt2hmeqCOMhVJ9jUNNLNGFWqS0BttRRJpbxGN8vFFXzSdzZyvZrzmVPCU/ujT+3162KHMYnsiDVmq1WgOtnUHOC4r0ytSyVOlZWTNOby47WtGLm1OsVMIpXrk1yzTcpcMTp/yvKKN+l6LagoFvLc2WraaralS2eoNSJpvpyy2VzEW0SDyuTq9feTPKa1yOXCu/v089XQGU2LzomGK3G1Y/OZUvXk4thzQZ74nVCxT5a1KcvFG/37+ud2KeBsJbEqF6CcLE68Trg7KwY9oL7dt6T6o6wbCLs1E9jh8E6jQ6qiHmXVZSBhtvn6/dzZGyxmtkylSj95wMXgvriyK7U8H1a/VZ0zKff59czJO1/LXt7bKeNwJitaoK7VpYPbgNHMJ4mj0q+sI1i3VtnUJESIzYPvg3jJbV/YYFTOVZiv2HTndHzhe4PjglmuUc7IFqmnPaovHNPozq9BJ81QHNbSKcM9FB9lvPnu7SlfrN7aH8bAFFezVTBuvM/JHI/1jvCEL+/z+e7Py5b3lbDC4bA1HqIxIrcwE06jO/b4/DJfsMBRQuHdRa4gDfz8+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IZbEUEQSVDhrndVgl6VwAJJdKMbZ82IYAdL2MIa9rAECQgAOw==</img> <url template="http://sharepointurl.com/searchcenter/Pages/Results.aspx" method="GET" type="text/html">
<param value="{searchTerms}" name="k" /></url><searchform>http://sharepointUrl.com/searchcenter/</searchform> </searchplugin>
3. Save it under [Firefox install dir]\searchplugins\ as sharepoint.xml usually “C:\Program Files\Mozilla Firefox\searchplugins”
4. Restart firefox
To use with with People search replace url with /SearchCenter/Pages/peopleresults.aspx
For IE you can use this site for custom search plugins http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx
Code Console Web Part
Interesting project by Einar Otto Stangvik, Basically you can execute server side code using webpart directly using browser with SharePoint.
I should say I haven’t tested it out but I can think of couple of ways it can be useful.
Click here for original blog post
http://einaros.blogspot.com/2009/05/codeconsole-web-part-for-sharepoint.html
STSADM Commands Cheat sheets/Poster
I found a list of STSADM commands for MOSS and WSS on Microsoft site. These are large images and can be printed as poster for your admin nerdiness right next your “Now slower with more bugs” sticker
MOSS: http://sharepoint.microsoft.com/sharepoint/Documents/STSADM%20Posters/Stsadm_Cmd-Line_MOSS_2007.png
WSS: http://sharepoint.microsoft.com/sharepoint/Documents/STSADM%20Posters/Stsadm_Cmd-Line_WSS_3.jpg
You can always use stsadm |find “add” to search or stsadm | more to list all the commands
more on piping stsadm here http://blogs.objectsharp.com/CS/blogs/max/archive/2008/05/15/piping-stsadm-command.aspx
Update : Complete reference of all stsadm commands http://blogs.technet.com/josebda/archive/2008/03/15/complete-reference-of-all-stsadm-operations-with-parameters-in-moss-2007-sp1.aspx
(Jquery)Display Video in SharePoint Blogs from document library
SharePoint Blogs OOB filters out all the html for embedding any kind of video in them. I use Windows live writer for my Blog post. I use one of the plug-in I think, but even though it wont embed the video within SharePoint it will show take a screenshot of the video and link to the external site, which is fine for me.
To Display local intranet videos within blog takes bit of work, either hyperlink to media file or Content Editor web part for embedded code.
I using Jquery to accomplish this.
Instead of embedded we shall use Hyperlinks to media files and Jquery.Media plugin for turning them into inline videos.
Steps
1.Create 2 Document Libraries
- Media: To store all your media files.
- Resources: To store JavaScript and other files.
2. Download Files.
- · Download Jquery JavaScript ( Note I am using 1.2.6 packed version) http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6.pack.js
- · Download Jquery Media Plug-in jquery.media.js
- · SWF Player here to play flv files. http://malsup.com/jquery/media/mediaplayer.swf
3.Upload the Jquery JS and mediaplayer.swf to Resource Document library
4. Edit Jquery Media JavaScript File . In Default Configuration section change location of mediaplayer.swf to the one you just uploaded. Save the file
5. Save and Upload Jquery Media to the Resources document library.
6. On Blog Home Page. Add a content Editor Web Part and Open Source Editor.
Add following script tags to it. (Change the src of javascript location to reflect the files you uploaded in steps above.)
<script type="text/javascript" src="/sharepoint/Sharepoint%20Blog/Resources/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="/sharepoint/Sharepoint%20Blog/Resources/jquery.media.js"></script>
<script type="text/javascript" >
$("a").media();
</script>
7.Upload some media files to Media Library
Create a new blog post
in Body Section add a Hyperlink to a video you uploaded to Media library.
File Jquery Media Supports
* Supported Media Players:
* – Flash
* – Quicktime
* – Real Player
* – Silverlight
* – Windows Media Player
For more information on Jquery Media click here http://malsup.com/jquery/media/#overview
Note : If script doesn’t execute replace inline script with this :
<script>
function loadMedia() {
$("a").media();
}
_spBodyOnLoadFunctionNames.push("loadMedia");
</script>
If that does not work I would try this in inline script tags
$(document).ready(function() {
$("a").media();
});





