<input type="hidden" name="VPos" runat="server" id="VPos" value="0" />
<input type="hidden" name="HPos" runat="server" id="HPos" value="0" />
<script type="text/javascript">
function RestoreScrollPosition() {
var vPos = document.getElementById("VPos");
var hPos = document.getElementById("HPos");
//alert(vPos.value);
scrollTo(hPos.value, vPos.value);
}
function getScrollXY() {
var scrOfX = 0, scrOfY = 0;
if (typeof (window.pageYOffset) == 'number') {
//Netscape compliant
scrOfY = window.pageYOffset;
scrOfX = window.pageXOffset;
} else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
//DOM compliant
scrOfY = document.body.scrollTop;
scrOfX = document.body.scrollLeft;
} else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
//IE6 standards compliant mode
scrOfY = document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;
}
return [scrOfX, scrOfY];
}
function SaveScrollPositions() {
pos = getScrollXY();
var vPos = document.getElementById("VPos");
var hPos = document.getElementById("HPos");
hPos.value = pos[0];
vPos.value = pos[1];
setTimeout('SaveScrollPositions()',10);
}
SaveScrollPositions();
window.onload = RestoreScrollPosition;
</script>
Monday, February 8, 2010
Friday, January 29, 2010
SharePoint Search Scope Drop Down List - Remove "This Site:"
In my Publishing portal, I have created 3 Search Scopes and configured the Search Settings to display the search results in Search Center (/Search/results.aspx).
It worked fine for all three scopes with no issues, but the problem is with the uninvited scope “This Site” . This is a contextual scope (Default Scope) which always included to the scope dropdown by default out of our notice. There is no UI Setting/Configs to change this behavior. This Contextual scope always displays the search results to the ooSearchresults.aspx page which I don’t want.
This unwanted scope (“This Site”) can be removed by injecting the following JavaScript to the master page.
<script type="text/javascript">
function SearchScDDLInj()
{
var srhScDDL = document.getElementById("ctl00$PlaceHolderSearchArea$ctl01$SBScopesDDL");
srhSpDDL.remove(0);
}
SearchScDDLInj();
</script>
Thanks!
It worked fine for all three scopes with no issues, but the problem is with the uninvited scope “This Site
This unwanted scope (“This Site
<script type="text/javascript">
function SearchScDDLInj()
{
var srhScDDL = document.getElementById("ctl00$PlaceHolderSearchArea$ctl01$SBScopesDDL");
srhSpDDL.remove(0);
}
SearchScDDLInj();
</script>
Thanks!
Subscribe to:
Posts (Atom)