我發現在網絡上的Sharepoint博客分類分頁問題的解決方案......它適用於我。 Thanks to this blog
您需要做的就是複製粘貼以下腳本。轉到博客/ category/Category.aspx並添加一個Content Editior Web部件。然後轉到源代碼編輯器並複製粘貼以下代碼。
您還可以確保隱藏Web部件,以便通過勾選佈局選項下的隱藏來使其不可見/煩人。
<script language ="javascript" type = "text/javascript" >
function changeLink(){
JSRequest.EnsureSetup();
var Category = JSRequest.QueryString["Name"];
var parent;
var child;
for (var counter =0; counter < 100; counter++){
var elementId = 'bottomPagingCellWPQ'+ counter;
if (document.getElementById(elementId)){
parent = document.getElementById(elementId);
child = parent.childNodes[0].childNodes[0].childNodes[0];
if (child.childNodes.length > 0){
for (var y = 0; y < child.childNodes.length; y++){
if(child.childNodes[y].childNodes){
if(child.childNodes[y].childNodes[0].tagName){
theAnchorTag = child.childNodes[y].childNodes[0];
for(var x = 0; x < theAnchorTag.attributes.length; x++){
if(theAnchorTag.attributes[x].nodeName.toLowerCase() == 'onclick'){
var str = theAnchorTag.attributes[x].nodeValue;
str = str.replace('?', '?Name=' + Category + '\\u0026');
theAnchorTag.attributes[x].nodeValue = str;
onclk = theAnchorTag.attributes[x].nodeValue;
theAnchorTag.onclick = new Function(onclk);
}
}
}
}
}
}
break;
}
}
}
addLoadEvent(changeLink);
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}
else{
window.onload = function(){
if (oldonload) {oldonload();}
func();}
}
}
</script>