You are viewing limited content. For full access, please sign in.

Question

Question

Default DocBrowseSearch box to current folder?

asked on February 17, 2014

We're trying to modify Weblink to default the search box up top to Current folder every time instead of defaulting it to Entire Repository.  Or even better would be to remove the entire repository option all together.   I've been poking around with the docbrowsesearch control but i'm not exactly sure which property i would need to tweak, or if that's the correct way to achieve this at all.  Any help would be appreciated, thanks.

0 0

Answer

APPROVED ANSWER
replied on February 17, 2014 Show version history

Hello,

 

You can change the behavior of the search selector using javascript added to browse.aspx. Insert the javascript before the closing body tag of the page.

 

The below javascript will first select the option "Current Folder" by setting the searchLocation value to "0" (Current Folder has value "0", Entire Repository has value "1"). The next line will set the display of the entire select to none, hiding the dropdown. You can omit this line if you still want the select box to display.

<body>
<!-- existing the browse.aspx code is here -->
  <script>
    document.getElementById('searchLocation').value = '0';
    document.getElementById('searchLocation').style.display = 'none';
  </script>
</body>

 

Alternatively, to just remove the "Entire Repository" option from the dropdown, you could do the following (NOTE: while the Entire Repository option has a value of 1, it's index is 0):

<body>
<!-- existing the browse.aspx code is here --> 
   <script>
    document.getElementById('searchLocation').remove(0);
  </script>
</body>
1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.