• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Add to favorites in the navbar

cobra1162

Active member
#1
Hello

Here's a small change to put a tab "add to favorites" in the navbar.


favooris EN.png
in the template navigation

Find:

Code:
        <!-- help -->
        <xen:if is="{$tabs.help}">
Add above:
Code:
        <!-- favoris-->
        <li class="navTab PopupClosed"><a href="javascript:bookmarksite('You-title', 'You-URL')" class="navLink">Add to Favorites</a></li>
Remember to change it (url and name of the forum)
Then add at the end of the template navigation


Code:
<!--add to favorites-->
<script type="text/javascript">

function bookmarksite(title,url){
if (window.sidebar) // firefox
   window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
   var elem = document.createElement('a');
   elem.setAttribute('href',url);
   elem.setAttribute('title',title);
   elem.setAttribute('rel','sidebar');
   elem.click();
}
else if(document.all)// ie
   window.external.AddFavorite(url, title);
}
</script>
<!--Add to favorites-->
Support français ICI
French support HERE
 

DSF

Well-known member
#4
Code:
<li class="navTab PopupClosed"><a href="javascript:bookmarksite('You-title', 'You-URL')" class="navLink">Add to Favorites</a></li>
In You-URL I must set my Path.
Is there a possibility to set the current actuell Path?
 

cobra1162

Active member
#6
<li class="navTab PopupClosed"><a href="javascript:bookmarksite('You-title', 'You-URL')" class="navLink">Add to Favorites</a></li>
sorry for the delay you replace you as the title of your forum and you the URL of your forum url
 

Brogan

XenForo moderator
Staff member
#7
I think the poster is looking for a way to set a dynamic URL based on which page they're on when the link is clicked.