首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >显示与SharePoint 2010中特定用户相关的横幅幻灯片

显示与SharePoint 2010中特定用户相关的横幅幻灯片
EN

Stack Overflow用户
提问于 2015-06-25 00:47:07
回答 1查看 99关注 0票数 0

我在财务部门工作,但我的经理要求我为我们的团队创建一个网站。我对HTML或Javascript几乎一无所知,只懂一点SharePoint 2010。我设法创建了大部分内容,但有一个问题要了我的命。我需要创建一个旋转的横幅或选项卡内容,以便当不同的用户登录时,他们看到不同的幻灯片或选项卡。例如,如果经理A登录,他应该看到他的客户的幻灯片或选项卡,以及这些客户每日报告的链接。当经理B登录时,他只能看到他的客户,等等。经理A看不到经理B的客户,反之亦然。

我现在最好的猜测是为所有经理的所有客户端创建标签,然后根据当前用户隐藏标签,但我不知道如何实现隐藏部分。任何帮助都将不胜感激!谢谢!

附注:到目前为止,我有一个旋转横幅的代码如下:

代码语言:javascript
复制
    <div class="pageTitle">
News &amp; Announcements
</div>
<div class="OuterLeft">
    <div class="InnerLeft1" style="width:292px; margin-right:15px; float:left;"><menu class="ms-SrvMenuUI">
    <ie:menuitem id="MSOMenu_Help" iconsrc="/_layouts/images/HelpIcon.gif" onmenuclick="MSOWebPartPage_SetNewWindowLocation(MenuWebPart.getAttribute('helpLink'), MenuWebPart.getAttribute('helpMode'))" text="Help" type="option" style="display:none">

    </ie:menuitem>
</menu></div>
    <div class="InnerLeft2" style="width:292px; float:left;"></div>
    <div class="InnerLeftBottom">
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td id="MSOZoneCell_WebPartWPQ5" valign="top" class="s4-wpcell-plain"><table class="s4-wpTopTable" border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td valign="top"><div WebPartID="0a0ee8ca-3783-456b-a7b2-3cdaf55f5a25" HasPers="false" id="WebPartWPQ5" width="100%" class="ms-WPBody noindex" allowDelete="false" style="" >
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">

<head>

<link rel="stylesheet" href="/RotatingBanner/css/slider3.css">
<script src="/RotatingBanner/js/jquery.min.js" type="text/javascript"></script>
<script src="/RotatingBanner/js/jquery.cycle.all.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();

jQuery(document).ready(function() {
    jQuery('.fp-slides').cycle({
        fx: 'scrollHorz',
        timeout: 5000,
        delay: 0,
        speed: 400,
        next: '.fp-next',
        prev: '.fp-prev',
        pager: '.fp-pager',
        continuous: 0,
        sync: 1,
        pause: 1,
        pauseOnPagerHover: 1,
        cleartype: true,
        cleartypeNoBg: true
    });
 });

</script>

<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:Keywords msdt:dt="string"></mso:Keywords>
<mso:_Author msdt:dt="string"></mso:_Author>
<mso:wic_System_Copyright msdt:dt="string"></mso:wic_System_Copyright>
<mso:_Comments msdt:dt="string"></mso:_Comments>
</mso:CustomDocumentProperties>
</xml><![endif]-->
<title></title></head>

<body>



<!-- Featured Content Slider Started -->
<div class="fp-slider clearfix">
    <div class="fp-slides-container clearfix">
        <div style="overflow: hidden;" class="fp-slides">


<!-- Slide 2 Code Start -->
            <div style="position: absolute; top: 0px; left: -610px; display: none; z-index: 5; opacity: 1;" class="fp-slides-items">
                <div class="fp-thumbnail">
                    <img src="/RotatingBanner/images/President's-Perspective_600x250.png" />
                        </div>
                <div class="fp-content-wrap">
                    <div class="fp-content">
                        <h3 class="fp-title"><a href="https://us-intranet.milliman.com/ceoblog/default.aspx" style="color:#fff;">Risk management: We are not alone</a> </h3>

<p>Discussions at a recent conference show that consulting firms like Milliman face a variety of similar risk-related issues.&nbsp;&nbsp;<a href="https://us-intranet.milliman.com/ceoblog/default.aspx" style="color:#fff;">continue reading &raquo;</a></p>
                    </div>
                    <div class="fp-prev-next-wrap clearfix">
                        <a class="fp-next" href="#fp-next"></a>
                        <a class="fp-prev" href="#fp-prev"></a>
                    </div>
                </div>
            </div>
            <!-- Slide 2 Code End -->


   <!-- Slide 1 Code Start -->
                    <div style="position: absolute; top: 0px; left: -610px; display: none; z-index: 5; opacity: 1;" class="fp-slides-items">
                        <div class="fp-thumbnail">
                            <img src="/RotatingBanner/images/connectlogo-01.png" />
                                </div>
                        <div class="fp-content-wrap">
                            <div class="fp-content">
                                <h3 class="fp-title"><a href="/Pages/MillimanConnect.aspx" style="color:#fff;">OneNote to rule them all</a> </h3>

                                <p>Deborah Wolf of the Knowledge Management team discusses the versatile OneNote note-taking tool and shows how Milliman practices are using it to better track and share information.&nbsp;&nbsp;<a href="/Pages/MillimanConnect.aspx" style="color:#fff;">continue reading &raquo;</a></p>
                            </div>
                            <div class="fp-prev-next-wrap clearfix">
                                <a class="fp-next" href="#fp-next"></a>
                                <a class="fp-prev" href="#fp-prev"></a>
                            </div>
                        </div>
                    </div>
            <!-- Slide 2 Code End -->



















<!-- Slide 4 Code Start -->
            <div style="position: absolute; top: 0px; left: 0px; display: block; z-index: 6; opacity: 1; width: 600px; height: 249px;" class="fp-slides-items">
                <div class="fp-thumbnail">
                    <img src="https://us-intranet.milliman.com/RotatingBanner/images/Insight.jpg" />
                </div>
                <div class="fp-content-wrap">
                    <div class="fp-content">
                        <h3 class="fp-title"><a href="http://us.milliman.com/insight/" style="color:#fff;">Insight: Telematics, microinsurance, longevity plans, and more</a> </h3>
                        <p>Read Milliman's latest thought leadership pieces on the updated Insight page.
 &nbsp;&nbsp;<a href="http://us.milliman.com/insight/" style="color:#fff;">continue reading &raquo;</a></p>
                    </div>
                    <div class="fp-prev-next-wrap clearfix">
                        <a class="fp-next" href="#fp-next"></a>
                        <a class="fp-prev" href="#fp-prev"></a></div>
                </div>
            </div>
            <!-- Slide 4 Code End -->



<!-- Slide 4 Code Start -->
            <div style="position: absolute; top: 0px; left: 0px; display: block; z-index: 6; opacity: 1; width: 600px; height: 249px;" class="fp-slides-items">
                <div class="fp-thumbnail">
                    <img src="/RotatingBanner/images/MMI.jpg" />
                </div>
                <div class="fp-content-wrap">
                    <div class="fp-content">
                        <h3 class="fp-title"><a href="http://us.milliman.com/uploadedFiles/insight/Periodicals/mmi/2015-MMI.pdf" style="color:#fff;">
2015 Milliman Medical Index</a> </h3>
                        <p>Healthcare costs for the typical American family of four reached $24,671 in 2015.
 &nbsp;&nbsp;<a href="http://us.milliman.com/uploadedFiles/insight/Periodicals/mmi/2015-MMI.pdf" style="color:#fff;">continue reading &raquo;</a></p>
                    </div>
                    <div class="fp-prev-next-wrap clearfix">
                        <a class="fp-next" href="#fp-next"></a>
                        <a class="fp-prev" href="#fp-prev"></a></div>
                </div>
            </div>
            <!-- Slide 4 Code End -->














        </div>

        <div class="fp-nav">
            <span class="fp-pager"></span></div>
        </div>

    <div style="clear: both;">
        <!-- Featured Content Slider End -->
    </div>
    <div style="padding: 0 10px;">
        <div style="position:relative;float:left;width:280px;">
            <a href="/Lists/News%20Article%20Archive">View News Article Archives &raquo;</a>
        </div>
        <div style="position:relative;float:right;width:280px;text-align:right;">
            <a href="mailto:newsbreak@milliman.com?subject=News%20Idea%20for%20Milliman%20Intranet%20and%20Newsbreak" >Submit a News Idea &raquo;</a>
        </div>
    </div>
</div>

<br clear="all"/>
</body>

        </div>
    </div>
</div>

<br clear="all"/>

</body>
</body>

</html>


</body>

</html>
/>

</body>
</body>

</html>


</body>

</html>
</div></td>
            </tr>
        </table><div class="ms-PartSpacingVertical"></div></td>
    </tr>
EN

回答 1

Stack Overflow用户

发布于 2015-06-25 15:49:32

你可以用一种简单的方式做到这一点,这是我给出的代码片段

代码语言:javascript
复制
 <head>
 <script type="text/javascript">
 ExecuteOrDelayUntilScriptLoaded(init,'sp.js');
var currentUser;
function init(){
this.clientContext = new SP.ClientContext.get_current();
this.oWeb = clientContext.get_web();
currentUser = this.oWeb.get_currentUser();
this.clientContext.load(currentUser);
this.clientContext.executeQueryAsync(Function.createDelegate(this,this.onQuerySucceeded), Function.createDelegate(this,this.onQueryFailed));
}

 function onQuerySucceeded() {
if(currentUser.get_loginName() == "manager a")
 {
document.getElementById('managerA').style.display = 'block';
}
 else if(currentUser.get_loginName() == "manager b")
 {
 document.getElementById('managerB').style.display = 'block';
 }
}

</script>
</head>
<body>


 <div id="managerA" style="display:none">
 //manager A links and content
 </div>
 <div id="managerB" style="display:none">
 //manager B links and content
 </div>
</body>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31032418

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档