Read me over at MSDN

Hi guys,

Sorry for the lack of posts lately. Life’s just been crazy with work and school. Anyways, most of my SharePoint Designer blogging efforts will now be located at http://blogs.msdn.com/spdsupport. Please subscribe to feed there, instead, and be sure to drop me a few comments if you have any. You can also hit me up through email: blogspd (at) microsoft.com.  Stay classy.

Displaying Hidden SharePoint Lists Using a Data View - Part 2

If you haven’t read Part 1 of this post, I suggest doing that first, or my steps won’t make sense. As mentioned last time, this will be a short addition to Part 1. This post will show how to insert the Item Number from the hidden SharePoint list into the Data View Web Part. I will also get into some simple Conditional Formatting to tidy things up. Let’s get started.

1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.

2. Open the .aspx file you were working with last time.

3. Put your cursor next to the list Title in the Data View. Type parentheses ( ), and put your cursor in the middle of those.

4. In the Data Source Library, right-click on XML Web Service from last time (probably called “Lists on sharepoint”), and select Show Data.

image

5. In the Data Source Library, scroll down in the shown data until you find “ItemCount”, right-click, and select Insert as Text.

image

6. Put your cursor next to the newly inserted ItemCount in the Data View. Hit spacebar and type: “items”. Should look something like the following.

image

Note: this is okay, but what if a list only has 1 item in it? Displaying “1 items” doesn’t make much sense. The verbiage is incorrect, so lets fix it.

7. Open Conditional Formatting task pane. Go to Task Panes | Conditional Formatting.

image

8. Highlight the letter “s” in “items”. In the Conditional Formatting task pane, click Create, and select Hide content…

image

9. In the Conditional Criteria dialog, set the following and click OK:

  • Field Name: ItemCount
  • Comparison: Equals
  • Value: ‘1′

image

Note: I took this idea (in fact, this two part series) from a demo I saw done by the ever popular Dustin Miller. Thank you, sir. :)

10. The next part is tricky to describe, but I will do my best. Go into Split or Code view, and remove any white space from “item” to where the <xsl:if …> begins. Basically, the word “item” should be butted up against <xsl:if …>, like so:

image

11.Save page, and look at your results in the browser. Should look something like this.

image

Let me know if these instructions worked for you guys, if you have any questions, or if I need to elaborate anywhere. Hope you had fun and are starting to see the subtle yet, obvious, power SharePoint Designer contains. Conditional Formatting is cool, right? B)

Did you enjoy this article? Please Recommend it on SharePointPedia.

SharePointPedia - Worth checking out

I stumbled upon SharePointPedia the other day while meandering among my RSS feeds, and in particular, this Michael Gannotti blog post. The site seems mostly unknown to the SharePoint community, at this point, but I suspect it will definitely pick up with time.

The mechanics of SharePointPedia is very Digg-like, whereas the community decides what content is worth checking out by “Recommending” articles. Personally, I find community-filtered content the best way discover useful and worth-while material; for me, it’s the most authoritative source possible.

MSDN, TechNet, and MS Team blogs are great, but this feels like a real “web 2.0″ stab at providing ways for Microsoft SharePoint users to connect, share, and engage with one another in a content-centric approach.

image

SharePointPedia.com is a web site where people discover and share useful content about SharePoint and SharePoint related products and technologies. It’s a social computing application built on top of Microsoft Office SharePoint Server (MOSS) 2007. Anyone with a Windows Live ID may become a registered user and can then submit content recommendations or requests, leave comments, or just vouch for whatever they like.

Note that SharePointPedia is not a wiki. It’s a “pedia” in the sense of being a compendium of useful content, but rather than being limited by just wiki functionality, it leverages the much broader set of capabilities in SharePoint. SharePointPedia is also about community, where you can find and connect with others, who have similar interests as you or who have recommended content relevant to you. We hope that you will find SharePointPedia useful, and we would greatly appreciate your feedback to make it even better.

The Microsoft SharePointPedia Team

Note: The site’s not without its hitches, though. It works horrendously poor in browsers other than Internet Explorer, the tag cloud is controlled by site admins, comment and profile functionality can be wonky at times. Anyways, it’s still worth taking a look as the benefits far outweigh the inconsistencies. Leave a comment and let me know your feelings on SharePointPedia. Here’s to hoping it gets more popular and polished with time…

Technorati Tags: , , , , , ,

Displaying Hidden SharePoint Lists Using a Data View - Part 1

I am going to show a neat little trick to display all of your hidden SharePoint lists using a Data View in SharePoint Designer 2007. It’s a great way to display a site’s lists all in one place, or get an idea of what lists exists on the site. Now, it should be noted, of course, that the hidden lists may be hidden for a reason. Right? ;)

Time to break the rules - I will keep my preface short and jump right into the steps.

1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.

2. Open the .aspx file you want the Data View to show on, or create a new .aspx page.

3. Open Data Source Library task pane. Go to Task Panes | Data Source Library.

image image

4. In the Data Source Library, expand out the [+] XML Web Services. Click Connect to a web service…

5. In the Data Source Properties dialog, enter in the location of your SharePoint site with “_vti_bin/lists.asmx?WSDL” appended. Example: http://foo/site/_vti_bin/lists.asmx?WSDL . Click Connect.

image

Note: the lists.asmx web service is available in all SharePoint installations, and in fact, is apart of SharePoint itself.

6. For the Operation, choose “GetListCollection”. Click OK.

7. In the Data Source Library, right-click on newly added XML Web Service (probably called “Lists on sharepoint”), and select Show Data.

image

8. Click Insert Selected Fields as… | Multiple Item View.

image

Ugh, looks ugly right? Let’s clean it up a bit.

9. On the inserted Data View, click the OOUI (on object user interface) [>] . Yep, that little ’square thing’. Click Edit Columns…

image

10. Remove all of the columns except for “Title”. Click OK.

image

11. On a list title (any one), click the OOUI [>]. Format as hyperlink.

image

Note: if you get prompted after this step, simply click yes.

12. In the Edit Hyperlink dialog, keep the text to display as {@Title} but change the address to be {@DefaultViewUrl}. If you want, you can click the Fx button to select the value. Make sure text to display and address are correct, and click OK.

image

We could stop here, but I am not satisfied yet. Let’s keep going.

13. Right-click in the table cell that contains the list title, select Insert | Column to the Left.

image

14. Put your cursor in the newly inserted table cell. Again, this should be to the left of the column that contains the list title.

15. In the Data Source Library, scroll down in the shown data until you find “ImageUrl”, right-click, and select Insert as Picture.

image

Note: if you get prompted after this step, blindly click yes again. And, if you want, re-size the column with the image to be about 35px wide.

Ah, now it looks proper! If you did this on pre-existing page you are good to go. But, if you did this on a blank .aspx page go ahead and attach the master page. Select Format | Master Page | Attach Master Page… | select master page and click OK.

16. Save page, and look at your results in the browser. Should look something like this.

image

Oh, wait, your’s doesn’t have the item numbers by it?! I will save the instructions for that on a brief Part 2 of this post. Keep and eye on it. :)

Let me know if these instructions worked for you guys, if you have any questions, or if I need to elaborate anywhere. I write these posts for you after all.

Did you enjoy this article? Please Recommend it on SharePointPedia.

SPD 2007 - Data View Parameters You Don’t Know About

After answering a forum post the other day where a person needed to have the logged in user’s name passed as a parameter to a data view, I realized my answer wasn’t common knowledge.

There is a collection of variables called ServerVariables that can access all of the IIS server variables. There are a lot of useful ones, and you can use these variables in your data view / form web parts as parameters.

Here are the basic steps access the variables:

1. On the Common Data View Tasks pane on your data view web part, click Parameters…

image

2. Click New Parameter, name the parameter MyServerVar (or, whatever you like), and set the Parameter Source to be Server Variable.

image

3. In Server Variable Name, enter in any of the available server variables (listed below). For sake of example, I am going to use LOGON_USER.

image

4. That’s it! Now MyServerVar can be used as a parameter in the data view / form web part. Use it to filter, sort, etc.

Here is a list of Server Variables you can use:

Variable Description
ALL_HTTP Returns all HTTP headers sent by the client. Always prefixed with HTTP_ and capitalized
ALL_RAW Returns all headers in raw form
APPL_MD_PATH Returns the meta base path for the application for the ISAPI DLL
APPL_PHYSICAL_PATH Returns the physical path corresponding to the meta base path
AUTH_PASSWORD Returns the value entered in the client’s authentication dialog
AUTH_TYPE The authentication method that the server uses to validate users
AUTH_USER Returns the raw authenticated user name
CERT_COOKIE Returns the unique ID for client certificate as a string
CERT_FLAGS bit0 is set to 1 if the client certificate is present and bit1 is set to 1 if the cCertification authority of the client certificate is not valid
CERT_ISSUER Returns the issuer field of the client certificate
CERT_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
CERT_SECRETKEYSIZE Returns the number of bits in server certificate private key
CERT_SERIALNUMBER Returns the serial number field of the client certificate
CERT_SERVER_ISSUER Returns the issuer field of the server certificate
CERT_SERVER_SUBJECT Returns the subject field of the server certificate
CERT_SUBJECT Returns the subject field of the client certificate
CONTENT_LENGTH Returns the length of the content as sent by the client
CONTENT_TYPE Returns the data type of the content
GATEWAY_INTERFACE Returns the revision of the CGI specification used by the server
HTTP_<HeaderName> Returns the value stored in the header HeaderName
HTTP_ACCEPT Returns the value of the Accept header
HTTP_ACCEPT_LANGUAGE Returns a string describing the language to use for displaying content
HTTP_COOKIE Returns the cookie string included with the request
HTTP_REFERER Returns a string containing the URL of the page that referred the request to the current page using an <a> tag. If the page is redirected, HTTP_REFERER is empty
HTTP_USER_AGENT Returns a string describing the browser that sent the request
HTTPS Returns ON if the request came in through secure channel or OFF if the request came in through a non-secure channel
HTTPS_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
HTTPS_SECRETKEYSIZE Returns the number of bits in server certificate private key
HTTPS_SERVER_ISSUER Returns the issuer field of the server certificate
HTTPS_SERVER_SUBJECT Returns the subject field of the server certificate
INSTANCE_ID The ID for the IIS instance in text format
INSTANCE_META_PATH The meta base path for the instance of IIS that responds to the request
LOCAL_ADDR Returns the server address on which the request came in
LOGON_USER Returns the Windows account that the user is logged into
PATH_INFO Returns extra path information as given by the client
PATH_TRANSLATED A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping
QUERY_STRING Returns the query information stored in the string following the question mark (?) in the HTTP request
REMOTE_ADDR Returns the IP address of the remote host making the request
REMOTE_HOST Returns the name of the host making the request
REMOTE_USER Returns an unmapped user-name string sent in by the user
REQUEST_METHOD Returns the method used to make the request
SCRIPT_NAME Returns a virtual path to the script being executed
SERVER_NAME Returns the server’s host name, DNS alias, or IP address as it would appear in self-referencing URLs
SERVER_PORT Returns the port number to which the request was sent
SERVER_PORT_SECURE Returns a string that contains 0 or 1. If the request is being handled on the secure port, it will be 1. Otherwise, it will be 0
SERVER_PROTOCOL Returns the name and revision of the request information protocol
SERVER_SOFTWARE Returns the name and version of the server software that answers the request and runs the gateway
URL Returns the base portion of the UR

Source or read more about it on MSDN.

Note: A fun trick to see what the server variable values actually are is to output them into your data view: <xsl:value-of select=”$MyServerParam” />

Now whenever you change Server Variable Name (ex: LOGON_USER to AUTH_TYPE) the value will be reflected in your data view.

Did you enjoy this article? Please Recommend it on SharePointPedia.

SPD 2007 - How to prevent Supporting Files from being incorrectly set to erroneous page

Many of us SharePoint / Designer power users have ran into this at some point or another. After replacing a normal list form with a custom list form on any of the supporting files (New, Edit, Display) for a SharePoint list, the list view properties do not work as expected. Hyperlinks for corresponding supporting file will point to erroneous or incorrect location.

Example: replacing a normal list form with a custom list form on supporting file
DispForm.aspx results in “display” hyperlinks going to an erroneous page, such as a different, un-intended supporting file.

This is incredibly frustrating, right?

Well, here is a sure-fire way to prevent this from occurring.

  1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.
  2. Expand out Lists -> [List Name] -> open DispForm.aspx .
  3. Highlight normal list form by clicking on it. This will select the entire web
    part.
  4. Right-click on selected web part, and choose Web Part Properties…
  5. Expand [+] Layout, check option for Hidden, click OK.
  6. With web part still highlighted, hit the right-arrow key once. Hit Enter. This creates some whitespace to insert.
  7. Go to File | Insert SharePoint Controls | Custom List Form…
  8. Select appropriate list or library, content type, and type of form to create. Click OK.
  9. Save page.

Keeping the normal list form on the page should ensure the supporting files stay intact. Think of this as a sort of “best practice” and you should never run into the problem again. :)

Did you enjoy this article? Please Recommend it on SharePointPedia.

MOSS - How to fix recurring Meeting Workspace error: ‘g_InstanceID’ is undefined

After changing the master page on a Meeting Workspace site, the recurring meeting workspace hyperlinks under “Select a date from the list below:” do not work and throw a JavaScript error.

If you create a custom master page and use it for your Meeting Workspaces, a JavaScript error is thrown.

ERRORS:
‘g_InstanceID’ is undefined

CAUSE:
The g_instanceId global JavaScript variable is declared in a script registered runtime by the Microsoft.SharePoint.Meetings.PropertyBag web control. This control is used in the master page that’s used by Meeting Workspace sites called “MWSDefault.master” (located on server in 12 hive\TEMPLATE\GLOBAL\).

STEPS TO REPRO:

  1. Create a new Workspace: Site Actions-> Create Site -> Select [Meetings] Basic Meeting Workspace, click Create.
  2. On Workspace site, add a Calendar list: Site Actions -> Create -> [Tracking] Calendar.
  3. Add a new event to Calendar list, make recurring event, and select [x] Use a Meeting Workspace to organize attendees, agendas, documents, minutes, and other details for this event. Click OK.
  4. Follow steps to create workspace for Calendar event. Go to workspace.
  5. Change master page for workspace: Site Actions -> Site Settings -> [Look and Feel] Master page -> select any master page for Site Master Page and System Master Page. Click OK. Go back to workspace.
  6. Now the links under “Select a date from the list below:” do not work and throw a JavaScript error message: ‘g_InstanceID’ is undefined .

WORKAROUND:

  1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.
  2. Expand out _catalogs -> masterpage -> open master page used on Meeting Workspace.
  3. In Code View, add the following line of code under <%@ Import Namespace=”Microsoft.SharePoint” %> tag:
    <%@ Register Tagprefix=”Meetings” Namespace=”Microsoft.SharePoint.Meetings” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
  4. Add the following line of code after opening <body …> tag: <Meetings:PropertyBag runat=”server”/>
  5. Save master page, check in (if necessary), and publish major version.

Free Training - SharePoint for the Web Site Builder

While browsing my RSS feeds this morning, I inadvertently came across a PixelMill PR release (for their SharePoint ’skins’). A few clicks later, and I found myself staring at a seemingly not-well-known-about SharePoint Designer training offering:

Free! - November 15th - SharePoint for the Web Site Builder
A live one-hour session where you will receive valuable insights for using SharePoint as a differentiator for current and prospective clients. Use the power of SharePoint and SharePoint Designer to create successful solutions for you and your clients.
This Webinar will cover:

  • Introduction to Windows SharePoint Services
  • Options for using SharePoint as a Web Site Management tool
  • Connecting Live, Dynamic Content from SharePoint to your Web site
  • Formatting SharePoint Data Views and Web Parts using SharePoint Designer
  • Using a Hosted SharePoint solution to your benefit

Time: 10:00am - 11:00am Pacific Time

Toll Free conference call access for U.S. and Canada callers. International toll number available.

Source: http://www.pixelmill.com/services/seminars-webinars.aspx

You can register here or follow the source link above. Nice find, right?

- Monjo

My home for SPD

I have A LOT of great content to share on this blog, and will continue to update as things come to me. Watch out this weekend for a couple neat DVWP tricks, and self-found workaround for "Attachment" functionality in Custom List Form (for "Display").

Trust me, SharePoint Designer can do more than you think! :)

- Monjo