2009-08-07 49 views

回答

4

的代碼啓發發現hereherehere,我在 的C創建這個文件:\ Program Files文件\ Common Files文件\ Microsoft共享\ Web服務器Extensions \ 12 \模板\ 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> 

重置IIS後,更改將應用​​於您網站上的所有wiki頁面。

+0

+1感謝您發佈您的代碼! – 2009-08-07 08:29:50

+0

嗨安德魯, 這看起來不錯,但是當我創建文件並重新啓動IIS輸入鏈接下拉沒有出現。還有什麼我必須做的,讓這個工作我在MOSS07? Cheers – 2010-01-21 02:54:15

+0

@Rowan,我建議你先從我發佈的三個鏈接中獲取代碼開始工作。我的代碼基本上是三者的結合。這些鏈接比我的文章有更好的分步說明。 – 2010-01-21 23:34:16

相關問題