Hi Folks, Does anyone have a quick solution to remove the More link from the top of Weblink 11? We are using Browse as our main page and trying to eliminate places where a public user can either get lost or otherwise get to the pages that are hidden, etc. Also, any help in changing Error page to link back to home instead of to the Welcome page would be greatly appreciated.
Question
Question
weblink 11 remove More link
Answer
Stuart,
To hide the More option, open Browse.aspx file in a text editor, copy the code below, paste it right above the </body> element located at the bottom of the file, and then save the file.
<script type="application/javascript"> (function() { $(".more-dropdown").hide(); })(); </script>
To modify the Error page to link back to the Browse page instead of the default Welcome page, open the Error.aspx file in a text editor, copy the code below, paste it right above the </body> element located at the bottom of the file, and then save the file.
<script type="application/javascript"> var x = document.getElementById("BackToWelcomeDiv"); x.innerHTML = '<a href="<%= Page.ResolveUrl("~/Browse.aspx?" + dbRepoParam)%>">Back to Browse Page</a>'; </script>
Hope this helps!
Wesley Funderberg
Replies
Hello there, I tried this and it did not work for me, but I am using Search in Weblink 11 and so I placed it in the Search.aspx just above the </body> as you stated for the Browse.aspx. I have saved it and restarted IIS, and reloaded the pages multiple times, and the "More" pull down is still there.
Any ideas?
Ok, I tried the new code in the Search.aspx and placed it above the </Body > element as suggested, however I might not have it just right. Below is the area of the aspx where I have it. It still does not work. I restarted IIS again, and reloading the Search page. I also tried it in the Browse.aspx just in case. Then even cleared cache, and cookies and restarted the browser. Still see "More". It does not look as clean below as it does in the aspx files but you see see the location where I placed it.
</head>
<script type="application/javascript">
(function() {
$("#moreDropdown").hide();
})();
</script>
<body id="searchPage" class="ltr" style="overflow: hidden; height: 100%" runat="server" >
<search-app><div style="padding: 30%; text-align: center;">Loading...</div></search-app>
<weblink:MediaDisplay id="mediaDisplay" runat="server" class="media-display"></weblink:MediaDisplay>
<script type="application/javascript" nonce="<%= PageNonce %>">
run({ str_json: <%= Str_JSON %>})
</script>
</body>
Ok, I did try the original code in that location and it did not work, but now even with the altered code, it still does not. I am wondering if it might be conflicting with something else I might have tried, but again after restarting IIS, clearing cache and reloading, More still is showing up. Below is where it is now.
<body id="searchPage" class="ltr" style="overflow: hidden; height: 100%" runat="server" >
<search-app><div style="padding: 30%; text-align: center;">Loading...</div></search-app>
<weblink:MediaDisplay id="mediaDisplay" runat="server" class="media-display"></weblink:MediaDisplay>
<script type="application/javascript" nonce="<%= PageNonce %>">
run({ str_json: <%= Str_JSON %>})
</script>
<script type="application/javascript">
(function() {
$("#moreDropdown").hide();
})();
</script>
</body>
A little more information. I created a new app, verified that the Search.aspx had the code above. When I use the Search with nothing special configured on the new Weblink app, I do not see the More and only the My Weblink. However as soon as I set up a Search Form, and Custom Link on the Welcome Page, the More button returns. If I remove the Custom Search, and reload the page and select Search at the top, it then shows only My Weblink again. So, my guess is that when using a "custom search" it must be using another file, or ignoring the code. Verified by re-adding the Custom Search, and restarting the browser, clicking on the Search on the Welcome Page and again More is there.
CustomSearch.aspx