sharepoint 中的用户特定主题
我有一个要求,在我的共享点网站中我想根据用户设置主题。
例如,假设用户 a 将其主题设置为 theme1,而用户 b 登录并将主题设置为 theme2。因此,当用户下次登录时,他必须看到他设置的主题。即主题a。
谁能告诉我最好的方法是什么?
提前致谢。
萨钦
I have a requirment where in my sharepoint site I want to set the theme according to user.
for e.g lets say if user a set his theme as theme1 and the user b logs in and set theme to theme2. So next time when user a log in he must have to see the theme set by him. I.e theme a.
Can any one tell me what will be the best approch to do it.
Thanks in advance.
Sachin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我曾经有过类似的需求。就我而言,他们希望用户能够更改 MOSS 门户的“颜色布局”(因此布局和字体相同,但每个主题的背景颜色和图像颜色不同)。我创建了一个“基本主题”,其中包含作为单个 CSS 文件的完整布局(提供的主题之一)。然后我创建了其他主题,例如“blue.css”、“red.css”、“green.css”等,并将所有这些文件放入
portal/ourthemes/
中。我们希望用户能够选择他们的主题,因此我们创建了一个新的用户配置文件属性“CurrentTheme”(Sharepoint 中央管理 -> 共享服务 -> 用户配置文件和属性 -> 添加配置文件属性),其定义为带有预定义选项列表的字符串。
然后我创建了一个简单的 ASP.Net 控件,其呈现为
(免责声明:实际代码有点长,因为我们使用每个用户缓存来避免每次用户加载页面时从
UserProfile
读取属性)然后我将此控件放入为该门户创建的母版页中。
编辑:为了进行缓存,我们创建了一个包含用户名并将生成的文本存储在其中的缓存键。结果是这样的:
I had a similar requirement once. In my case they wanted users to be able to change the "color layout" of a MOSS portal (so the layout and fonts was the same, but background color and colors of images were different in each theme). I created a "base theme" which included a complete layout (one of the provided themes) as a single CSS file. Then I created additional themes, such as "blue.css", "red.css", "green.css" et cetera and put all those files in
portal/ourthemes/
.We wanted the users to be able to choose their theme, so we created a new user profile property "CurrentTheme" (Sharepoint Central Administration -> Shared services -> User profiles and properties -> Add profile property) which was defined as string with a pre-defined list of choices.
Then I created a simple ASP.Net control which rendered as
(Disclaimer: the actual code was a bit longer, because we used caching per-user to avoid reading the property from
UserProfile
every time user loaded the page)Then I put this control in the master page created for that portal.
EDIT: To do the caching, we created a cache key which contained user name and stored the generated text in there. The result was something like this: