Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie..Can I display a User ID on main page?

Status
Not open for further replies.

PaddyT

Technical User
Dec 12, 2000
76
GB
Have installed Sharepoint on 2003. I am in the process of setting up a test site, to try things out. What I would like to be able to do is add personalised info on the main page. The Sharepoint site will be based in a school, so it would be good if I could get it to recognise the user and display a welcome to that user.

Such as "Welcome %username%"

Is this possible? Also, where can I get more webparts from? Have done a search, but have not found that many decent sites.
Thanks in advance.
 
You can get the current username from the object model:
SPWeb.CurrentUser but you should put this in a webpart and put that on the page.

As for some existing webparts... microsoft offers some more on there site, they have Portal parts but also some WSS parts. Also search for Jan Tielens
 
Ok..So it can be done. Is this straight forward? Apologies, but still working through the basics here. Where would I find the object model section..? I.e. whats steps should I take to complete his?

Thanks again in advance..
 
I think thomas's idea is better for you right now.. But if You are intrested in building you own webparts i suggest you begin by going over the programming task in:

WSS (and portal server) have a wide rang of objects, representing each level of the architecture, The most common are SPSite, SPWeb en SPFile... You can always get the SPSite object form code and you can work trough the object model form there.

Code:
SPSite SiteCollection = SPControl.GetContextSite(Context);
SPWeb Web = SiteCollection.OpenWeb()
SRSet = Web.SearchDocuments(<searchInput>);
			
foreach( SPSearchResult oSR in SRSet )
{
<process results here>
}

This is for example a webpart where you use the search methode of WSS, so you can make modifications to the original search.
(you do need SQL Server for search not WMSDE)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top