Jquery 如何使传入链接在Sharepoint wiki中显示为下拉列表?

Jquery 如何使传入链接在Sharepoint wiki中显示为下拉列表?,jquery,sharepoint,moss,Jquery,Sharepoint,Moss,Sharepoint wiki的“传入链接”功能很酷,但必须转到另一个页面才能查看列表是件麻烦事 是否可以用显示同一页面上链接的下拉菜单替换传入链接超链接?受找到的代码启发,我在中创建了此文件 C:\Program Files\Common Files\Microsoft Shared\Web服务器扩展\12\TEMPLATE\CONTROLTEMPLATES\WikiMiniConsole.ascx <%@ Control Language="C#" AutoEventWireup=

Sharepoint wiki的“传入链接”功能很酷,但必须转到另一个页面才能查看列表是件麻烦事


是否可以用显示同一页面上链接的下拉菜单替换传入链接超链接?

受找到的代码启发,我在中创建了此文件 C:\Program Files\Common Files\Microsoft Shared\Web服务器扩展\12\TEMPLATE\CONTROLTEMPLATES\WikiMiniConsole.ascx

<%@ Control Language="C#"   AutoEventWireup="false" %>
<%@Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>
<%@Register TagPrefix="SPHttpUtility" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.Utilities"%>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>

<SharePoint:RenderingTemplate ID="WikiMiniConsole" runat="server">
    <Template>
        <div style="position:relative;top:0;left:0;">
        <div class="ms-wikieditouter">
        <table  id="miniconsole" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
            <table class="ms-wikieditsecond" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
                <table class="ms-wikieditthird" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
                    <!-- this is for the orange cast inside the menu -->
                    <table class="ms-wikieditorange" cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tr>
                        <td class="ms-wikieditorangeinnera" style=";width:100%;">&nbsp;</td>
                    </tr>
                    <tr><td>
                        <wssuc:ToolBar CssClass="ms-wikitoolbar" runat="server">
                        <Template_Buttons>
                            <SharePoint:WikiEditItemButton Text= "<%$Resources:wss,siteactions_wikieditpage%>" runat="server"/>
                            <SharePoint:WikiPageHistoryButton Text= "<%$Resources:wss,siteactions_viewpagehistory%>" ButtonID="WikiPageHistory" runat="server"/>
                            <SharePoint:WikiIncomingLinksButton Text= "Incoming Links" ButtonID="WikiIncomingLinks" runat="server"/>
                        </Template_Buttons>
                        </wssuc:ToolBar>
                    </td></tr></table>
                 </td></tr></table>
            </td></tr></table>
        </td></tr></table>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"> </script>
<script type="text/javascript"> 
$(function() { 

    var toc = "<div id='toc' style='background:#EBF3FF;"
                +"border:1px solid #6F9DD9;display:none;"
                +"position:absolute;top:127;right:11;width:250px;"
                +"text-align:left;'></div>";

    $("td.ms-bodyareaframe:first").append(toc);

    //get the url for the incoming links page 
    u = $("a[id$=WikiIncomingLinks_LinkText]")[0].href; 

    //get the target container and load it with the incoming links 
    //filtered to show the links list only 
    $("#toc").load(u + " .ms-propertysheet");

    $("#toc").wrapInner("<ul style='padding:2px;margin:0;list-style-type:none;'></ul>");
    $("#toc a").wrap("<li style='padding:0;margin:0;'></li>");
    $("#toc li").prepend("<img style='margin-right:5px;' alt='' src='/_layouts/images/square.gif'/>");
    $("#incominglinks").click(function(){
        $("#toc").toggle();
    });

    // override the target of our hyperlink to bring up the menu
    $("#ctl00_PlaceHolderMiniConsole_ctl00_ctl00_ctl00_RptControls_WikiIncomingLinks_LinkText").attr("href", "#")
    $("#ctl00_PlaceHolderMiniConsole_ctl00_ctl00_ctl00_RptControls_WikiIncomingLinks_LinkText").click(function(){
        $("#toc").toggle();
    });  
}); 
</script> 



        </div></div>
    </Template>
</SharePoint:RenderingTemplate>

$(函数(){
var-toc=“”;
$(“td.ms bodyareaframe:first”)。追加(toc);
//获取传入链接页面的url
u=$([a[id$=WikiIncomingLinks\u LinkText])[0].href;
//获取目标容器并用传入链接加载它
//过滤以仅显示链接列表
$(“#toc”).load(u+”.ms属性表);
$(“#toc”).wrapInner(“
    ”; $(“#toc a”).wrap(“
  • ”); $(“#toc li”)。前缀(“”); $(“#收入链接”)。单击(函数(){ $(“#toc”).toggle(); }); //覆盖超链接的目标以打开菜单 $(“#ctl00#占位符迷你控制台#ctl00#ctl00#RptControls#WikiIncomingLinks#LinkText”).attr(“href”,“#”) $(“#ctl00_占位符迷你控制台_ctl00_ctl00_RptControls_WikiIncomingLinks_LinkText”)。单击(函数(){ $(“#toc”).toggle(); }); });

    重置IIS后,更改将应用于站点上的所有wiki页面。

    受找到的代码启发,我在中创建了此文件 C:\Program Files\Common Files\Microsoft Shared\Web服务器扩展\12\TEMPLATE\CONTROLTEMPLATES\WikiMiniConsole.ascx

    <%@ Control Language="C#"   AutoEventWireup="false" %>
    <%@Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>
    <%@Register TagPrefix="SPHttpUtility" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.Utilities"%>
    <%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
    
    <SharePoint:RenderingTemplate ID="WikiMiniConsole" runat="server">
        <Template>
            <div style="position:relative;top:0;left:0;">
            <div class="ms-wikieditouter">
            <table  id="miniconsole" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
                <table class="ms-wikieditsecond" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
                    <table class="ms-wikieditthird" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
                        <!-- this is for the orange cast inside the menu -->
                        <table class="ms-wikieditorange" cellspacing="0" cellpadding="0" border="0" width="100%">
                        <tr>
                            <td class="ms-wikieditorangeinnera" style=";width:100%;">&nbsp;</td>
                        </tr>
                        <tr><td>
                            <wssuc:ToolBar CssClass="ms-wikitoolbar" runat="server">
                            <Template_Buttons>
                                <SharePoint:WikiEditItemButton Text= "<%$Resources:wss,siteactions_wikieditpage%>" runat="server"/>
                                <SharePoint:WikiPageHistoryButton Text= "<%$Resources:wss,siteactions_viewpagehistory%>" ButtonID="WikiPageHistory" runat="server"/>
                                <SharePoint:WikiIncomingLinksButton Text= "Incoming Links" ButtonID="WikiIncomingLinks" runat="server"/>
                            </Template_Buttons>
                            </wssuc:ToolBar>
                        </td></tr></table>
                     </td></tr></table>
                </td></tr></table>
            </td></tr></table>
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"> </script>
    <script type="text/javascript"> 
    $(function() { 
    
        var toc = "<div id='toc' style='background:#EBF3FF;"
                    +"border:1px solid #6F9DD9;display:none;"
                    +"position:absolute;top:127;right:11;width:250px;"
                    +"text-align:left;'></div>";
    
        $("td.ms-bodyareaframe:first").append(toc);
    
        //get the url for the incoming links page 
        u = $("a[id$=WikiIncomingLinks_LinkText]")[0].href; 
    
        //get the target container and load it with the incoming links 
        //filtered to show the links list only 
        $("#toc").load(u + " .ms-propertysheet");
    
        $("#toc").wrapInner("<ul style='padding:2px;margin:0;list-style-type:none;'></ul>");
        $("#toc a").wrap("<li style='padding:0;margin:0;'></li>");
        $("#toc li").prepend("<img style='margin-right:5px;' alt='' src='/_layouts/images/square.gif'/>");
        $("#incominglinks").click(function(){
            $("#toc").toggle();
        });
    
        // override the target of our hyperlink to bring up the menu
        $("#ctl00_PlaceHolderMiniConsole_ctl00_ctl00_ctl00_RptControls_WikiIncomingLinks_LinkText").attr("href", "#")
        $("#ctl00_PlaceHolderMiniConsole_ctl00_ctl00_ctl00_RptControls_WikiIncomingLinks_LinkText").click(function(){
            $("#toc").toggle();
        });  
    }); 
    </script> 
    
    
    
            </div></div>
        </Template>
    </SharePoint:RenderingTemplate>
    
    
    $(函数(){
    var-toc=“”;
    $(“td.ms bodyareaframe:first”)。追加(toc);
    //获取传入链接页面的url
    u=$([a[id$=WikiIncomingLinks\u LinkText])[0].href;
    //获取目标容器并用传入链接加载它
    //过滤以仅显示链接列表
    $(“#toc”).load(u+”.ms属性表);
    $(“#toc”).wrapInner(“
      ”; $(“#toc a”).wrap(“
    • ”); $(“#toc li”)。前缀(“”); $(“#收入链接”)。单击(函数(){ $(“#toc”).toggle(); }); //覆盖超链接的目标以打开菜单 $(“#ctl00#占位符迷你控制台#ctl00#ctl00#RptControls#WikiIncomingLinks#LinkText”).attr(“href”,“#”) $(“#ctl00_占位符迷你控制台_ctl00_ctl00_RptControls_WikiIncomingLinks_LinkText”)。单击(函数(){ $(“#toc”).toggle(); }); });

      重置IIS后,更改将应用于站点上的所有wiki页面。

      您好,Andrew,这看起来很棒。但是,当我创建文件并重新启动IIS时,未显示传入链接的下拉列表。我还需要做些什么才能让这一切顺利进行吗?Cheers@Rowan,我建议您首先从我发布的三个链接中获取代码。我的代码本质上是这三者的组合。这些链接比我的文章有更好的分步说明。嗨,安德鲁,这看起来很棒,但是当我创建文件并重新启动IIS时,没有出现传入链接的下拉列表。我还需要做些什么才能让这一切顺利进行吗?Cheers@Rowan,我建议您首先从我发布的三个链接中获取代码。我的代码本质上是这三者的组合。这些链接有比我的帖子更好的分步说明。