U2U Blog

for developers and other creative minds

Using audiences to show or hide menu items

In this article I want to show you that audiences can be used not only for webparts but also to hide menu items in the quick launch.

First of all, an audience is a group of people who are sharing the same interest. You could for example show football items for the guys and show (be careful Kevin) "Cooking with Jamie Oliver" or "like to shop" items for the girls J.

Before we can create such audiences we need to update some profilefields to group people with the same interests. The place to update profiles and create audiences is in the shared service provider which you can find in the SharePoint Central Administration.

I'm going to add "Cooking with Jamie Oliver" to the interest fields of Annelies Peeters (lets all wish her good luck with her end terms at college) and "Football" to the interests of me.

Once the profiles are updated, we can create our audiences. To create an audience we need to click on the shared services link and choose audiences. Once you are on the audience page you can create an audience by clicking on the "Create audience" linkbutton. We are going to create 2 audiences based on the "Interests" property of a profile.

Besides the name (Girl Audience) of the audience we need specify the owner of the group and also if one or all of the rules needs to be satisfied to get in the audience. For this demo, it doesn't matter because we are only going to use 1 profile property.

After creating the Audience you need to specify the rules. The rule that we are going to use for this audience is "Cooking with Jamie Oliver" rule.

You can do the same for the Guys Audience and use the "Football" rule.

After all set and done, the last thing that we need to do is compiling our audience and check if the members are included in the audience.

Okay, we can close the Central Administration and open our collaboration portal. For this demo, I'm going to use the "Document Center".

The thing that we want to do is show football items in the quick launch for the guys and "cooking" items for the girls. Click on Site Actions and Site Settings to go to the navigation settings.

Let's add two links, a cooking link and a football link. While creating the link we are also going to specify to which audience we are going to show the link in the menu.

The only thing we need to do now is login as Annelies and as Kevin and check the links.

As you can see we have different items in the quick launch.

Again you see how easy it is, hope you enjoyed reading it.

SilverLight

To get rid of every confusion between WPF and WPF/E, Microsoft announced SilverLight as the new name for WPF/E.

Read more about it on SilverLight

Belux Developer-ITPro Days

This was a great event with lots of excellent speakers. Good to meet Kimmo, Doug and others. I really enjoyed delivering the three sessions to the local public here and I hope anybody attending them learned new stuff and liked the content. I really liked showing off the AJAX integration in SharePoint Web Parts. Congrats to Jan again for his latest version of the SmartPart that supports this out-of-the-box. He could not make it because he just became dad for the first time this week. Also congratulations to the organizers. I have been at many conferences and I fully understand all of the hard work that is involved to get it organized. MS Belux did a great job.

Next conference for me is the Microsoft WinDays 2007 in Croatia. I will be delivering one session on Web Content Management and also the closing keynote session with an overview of MOSS 2007. Looking forward to this.

Showing list items from another site

One of the questions people ask me during the SharePoint sessions is: "How can I show a list on a page which is not included in the site".

Good question because SharePoint only show lists that are available on the site where you want to edit the page.

Well, there is a work around for it, and the solution is SharePoint Designer. To show you the work around I'm going to write down the steps that you need to take to show an external list on a page.

First thing that I'm going to do is creating a links list (could be any other list) in a Site which I called Site A .

Once the list is created, I'm going to create a new site where I want to show the items on, the new site is called Site B.

After creating Site B, you open SharePoint Designer and open this site:

Once, your site is opened, you can double-click on the default.aspx page to open this page. When your page is opened you can switch to design view, because why would I write code if I can use drag and drop functionality ( Lazy me J ).

So we have our default.aspx page opened, and we want to drag a list in the left webpartzone. To have an overview of all the available lists we need to open up the Data source task pane.

This Date Source task pane only shows the lists and document libraries that are included in the site but the idea is that we want to show a list from another site. If you look at the bottom of your Data Source task pane you see a linkbutton which gives you the opportunity to connect to another library (Woehoew J).

When I click the linkbutton a dialog box will pop up where I can fill in the URL to the site where I want to take the list items from, in my case this is Site A:

 

Once I've made a connection to the site, you'll see that you can select the lists and document libraries from the Data Source task pane. The last thing that I need to do is dragging the list ( My Favourite Links on Site A ) on my page to the webpartzone.

Additionally you could remove or add some columns by pressing the Edit Columns link button.

To verify that the list is on your page, open your browser and go to Site B:

So that's it, Hope you liked reading this J.

Opening page in new window

Apparently, a book is not something that can be used to have a nice book shelfJ and show off to visitors.

Today I'm reading the book from Todd C. Bleeker, Developer's Guide to WSS 3.0, and I found a way to open pages in a new window when clicking on a link in the Quick Launch.

If you click on a link in the Quick Launch,by default, your page will open up in the same window because the Microsoft guys didn't foresee a checkbox "open in a new window". You could fix this by opening SharePoint Designer but Todd has another solution. Add JavaScript in the URL Box

JavaScript:window.open("http://www.u2u.info/blogs/kevin", "_blank");history.go(0);

Thanks Todd