sharepoint网站欢迎页面 [英] sharepoint sites welcome page

查看:95
本文介绍了sharepoint网站欢迎页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将用户重定向到不同的URL日志记录到网站,所以请帮我解决这个问题.

i need to redirect the users to different url logging to the sites so please help me with the approach.

如果该任务有任何自动化方法,则我有更多的站点要重定向.

I have more number of sites to be redirected ,if any automation available for this task.

闪电战

推荐答案

您好

Hi Blitz,

作为一种解决方法,您可以使用SharePoint Designer在欢迎页面中编写一些JS代码以获取当前用户.然后,根据用户信息,您可以重定向到相关的URL.

As a workaround, you could write some JS code in the welcome page with SharePoint designer to get the current user. Then according the user information, you can redirect to the related URL.

下面有一个演示.

<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
var loginName;
var id;
var title;
var email;
var user;

function onQuerySucceeded() {
    loginName=user.get_loginName();
    id=user.get_id();
    title=user.get_title();
    email=user.get_email();
    if(title=="System Account"){
        window.location.href="http://wakaka:17710/sites/common/SitePages/How%20To%20Use%20This%20Library.aspx";
    }
}

function onQueryFailed() {
    alert('error');
}


(function(){ var context = SP.ClientContext.get_current(); 用户= context.get_web().get_currentUser(); context.load(用户); context.executeQueryAsync(onQuerySucceeded,onQueryFailed); }); </script>
(function(){ var context = SP.ClientContext.get_current(); user = context.get_web().get_currentUser(); context.load(user); context.executeQueryAsync(onQuerySucceeded,onQueryFailed); }); </script>

注意将JS代码放在 < asp:Content ContentPlaceHolderId ="PlaceHolderMain" runat =服务器">//asp:Content> 像下面的图片.

Notice put JS code in the tag of <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"></asp:Content > like picture below.

还有另一种方式.您可以创建一个列表,然后在列表中添加用户和相关的URL.然后循环进入列表,并通过在欢迎页面中添加JS代码,根据当前用户重定向到相应的URL.

There is another way. You could create a list and add users and related URLs in the list. Then loop in the list and redirect to the corresponding URL according to the current user by adding JS code in the welcome page.

最诚挚的问候,

刘李


这篇关于sharepoint网站欢迎页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆