English 中文(简体)
用户具体主题:共享点
原标题:User specific theme in sharepoint

我再次问,在我共同点的网站上,我想根据用户确定主题。

例如,请指出,如果用户把主题1和用户标志定为主题2,并确定主题。 因此,他今后在使用标识时,必须看到他确定的主题。 页: 1

任何人都能够告诉我,这样做的最佳时机是什么。

提前感谢。

Sachin

最佳回答

我曾经有过类似的要求。 在我的案件中,他们希望用户能够改变MOSS门户网站的“栏目布”(因此,布局和字体相同,但每个专题的图像背景颜色和颜色各不相同)。 我创建了一个“基准主题”,其中包括一个完整的布局(所提供主题之一)作为单一的中央支助事务档案。 随后,我又提出了其他主题,如“蓝色、cs”、“红树”、“绿化物”和冰箱,并将所有这些档案列入<条码>。

我们希望用户能够选择自己的主题,因此,我们创造了一种新的用户形象财产“CurrentTheme”(Sharepoint Central Administration -> 共享服务-> 用户概况和特性-> 附加物),被定义为带有预先界定的选择清单。

然后我设立了一个简单的伙伴关系。 净控制

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
  Dim oProf As Microsoft.Office.Server.UserProfiles.UserProfile = Microsoft.Office.Server.UserProfiles.ProfileLoader.GetProfileLoader.GetUserProfile()
  Dim UserTheme As String
  Try
    If oProf.Item("CurrentTheme") IsNot Nothing Then
      UserTheme = oProf.Item("CurrentTheme").Value.ToString()
    Else
      UserTheme = "blue"
    End If
  Catch ex As Exception
     shouldn t fail if we don t know the value
    UserTheme = "blue"  a default value for users who dont have a theme yet
  End Try

  writer.WriteLine("<link rel= stylesheet  type= text/css  href= /portal/ourthemess" & Trim(UserTheme) & ".css  />")
End Sub

(Disapper:the actual Code was a bit long, as we used caching peruser to preventread the property from UserProfile 每当用户装上该页时

然后,我把这一控制放在为该门户设立的总页上。

EDIT:为了进行骑手,我们创建了一个含有用户名称的切身钥匙,并将生成的文本存放在其中。 结果是:

Dim KeyName As String = Page.User.Identity.Name & "_CurrentTheme"
If (Not Me.Page.Cache.Item(KeyName) Is Nothing) Then 
   writer.Write(Page.Cache.Item(KeyName).ToString)
Else 
   ...code posted previously goes in here

   at the end
  Me.Page.Cache.Add(KeyName, _
              AllContentRenderedInPreviousCodeAsString, _
              Nothing, _
              Caching.Cache.NoAbsoluteExpiration, _
              Caching.Cache.NoSlidingExpiration, _
              Caching.CacheItemPriority.Low, Nothing)
End If
问题回答

暂无回答




相关问题
SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

UI automated testing within SharePoint

I m looking for automated Functional Testing tools that can manipulate SharePoint sites, libraries, and documents thought the web interface. It needs to be extensible enough to handle any custom ...

Enable authorization on sitemap provider

I want to enable Authorization on the Site map provider. We have enabled anonymous access to the site and we want the Site map provider to be visible only to authorized users. I tried ...

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...