Is there a way to have the 'Home' button on the Browse.aspx page direct users to the root of the repository instead of going back to the Welcome.aspx page? If so what files would I need to edit in order to accomplish this?
Question
Question
Answer
Ah my misunderstanding.
In that case an option would be to use jquery to change the Home link after it's rendered by the page as we can't use CSS in the WebLinkStyles.css to change attribute values.
In browse.aspx provide a reference to the jquery library like so:
<html> <head runat="server"> <title>Laserfiche WebLink</title> <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"/> <link rel="SHORTCUT ICON" href="favicon.ico" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
This is linking to google, you could also download this and store it locally in the script folder and reference it there.
Then add in the following code right after that reference and before the ending </head> tag.
<script> $(document).ready(function(){ $("a.NavLink:nth-child(1)").removeAttr("href"); $("a.NavLink:nth-child(1)").bind("click", function(){ $(".ClickableBreadcrumb:nth-child(1)")[0].click() }); }); </script>
Now the home button will behave identical to the breadcrumb that responds to the root of the repository. Note, if you are already at the root of the repository, the home button will do nothing.
Replies
Yes there is!
Edit the Browse.aspx page located in your Weblink 8/Web Files directory. (Make a backup first!)
Change the line
<div><!-- WebLink logo --><a href="<%= Page.ResolveUrl("~/Welcome.aspx") %>" title="<%= m_strings.GetString("STR_HOME") %>"><img style="Z-INDEX: 102;" alt="Laserfiche WebLink" title="<%= m_strings.GetString("STR_HOME") %>" src="<%= GetImagePath(Page.ResolveUrl("~/images/LfWLlogo.gif")) %>" /></a></div>
Remove <%= Page.ResolveUrl ("~/Welcome.aspx")%> and place in your URL to the repository root.
To find the URL to the root of your repository is another adventure.
When navigating through the browser right click on the root of your repository and select inspect element.
You should see something like:
<span id="FolderBreadcrumbNavigation" class="BreadcrumbNavigation" style="unicode-bidi:override;"> <div id="FolderBreadcrumbNavigation_DisplayDiv"> <div> <span style="unicode-bidi:embed;"> <a class="ClickableBreadcrumb" href="javascript:__doPostBack('FolderBreadcrumbNavigation$_ct150$_ct10','')" onclick="return true;"></a>
That last line is what you want to add in to your Browse.aspx.
For this case it'd be
"javascript:__doPostBack('FolderBreadcrumbNavigation$_ct150$_ct10','')" onclick="return true;"
But it could change based on your setup, so inspect the element to get the right URL for your root repository.
Directly editing the server side code variables is spelled out by Alexander Huang over in this post for further options. https://answers.laserfiche.com/questions/51333/Configure-WebLink-to-redirect-to-an-internal-page-when-clicking-on-the-My-WebLink-button--
Before I go and test this out do you happen to know if this will effect the Logo button as well?
Edit:
Tested this out and it only affects the image logo for Weblink and does not change the home button. What I'm looking for is the change the navigation tab that is commented as <!--Navigation Tabs -->
I ended up keeping the source code for the ajax library pointed to the original location. I couldn't get it to work when I had the script on the local drive. I did change the href to http://(serverName)/WebLink8/Browse.aspx?startid=1&dbid=0. I adjusted this because the javascript:__doPostBack('FolderBreadcrumbNavigation$_ct150$_ct10','') would not load the rest of the panels on the page. After doing that adjustment it worked perfectly. Thanks again for the help!
Is there a way to simply hide the Home button instead of redirecting it?
Hi Jen,
Yep - that's in the WebLink Designer under the 'Navigation' tab. It's the first checkbox: 'Show Welcome Page link'. As you can see in the screencap, you also have the option to hide either of the others ('Browse' and 'Search').
Thanks, Melanie. For some reason, I skipped right over that Tab in the Designer.