如何使传入链接在 Sharepoint wiki 中显示为下拉菜单?

发布于 2024-07-30 04:42:02 字数 96 浏览 0 评论 0原文

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

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

The incoming links feature of the Sharepoint wiki is cool, but it's a hassle having to go to another page to see the list.

Is it possible to replace the Incoming Links hyperlink with a drop-down menu showing the links on the same page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜肉鲜肉永远不皱 2024-08-06 04:42:02

受到此处、此处此处,我在中创建了此文件
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\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%;"> </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>

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

Inspired by the code found here, here and here, I created this file in
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\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%;"> </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>

After resetting IIS, the change is applied to all wiki pages on your site.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文