I've written a few plugins that add buttons to the userbar? If so, there are a few discussions about 3 weeks ago that might be helpful that I participated in regardong adding tabs which is very similar.
Hope this helps.
The link you provided sends us to an unanswered discussion. Was that the intention?
I am also trying to add a new custom link to the Navbar in Jive 5, and am finding it difficult to find any detailed instructions on how to do this. I am finding not much up to date info on this sort of thing.
Any help is greatly appreciated.
I'm wondering how to add it to my site...
There's already a Navbar, which contains the following items:
...and populate it.
If the aforementioned Navbar is the one you're talking about, you could do this as follows:
1) For statically defined menu items, override the navBarLinks bean like so in your spring.xml file of your custom plugin:
<bean id="navBarTestLink" class="com.yournamespace.TestLink" parent="actionLinkBase" scope="prototype"> <property name="ID" value="jive-nav-link-test"/> <property name="nameKey" value="nav.bar.test.link"/> <property name="url" value="/test"/> <property name="linkCss" value="j-globalNavLink j-ui-elem"/> </bean> <bean id="navBarLinks" class="com.jivesoftware.community.util.spring.MergeableCollection" scope="prototype"> <property name="source"> <util:list value-type="com.jivesoftware.community.web.component.ActionLink" scope="prototype"> <ref bean="navBarHomeLink"/> <ref bean="navBarTestLink"/> <ref bean="navBarActivityStreamLink"/> <ref bean="navBarInboxLink"/> <ref bean="navBarActionsLink"/> <ref bean="navBarAppsLink"/> <ref bean="navBarBrowseLink"/> </util:list> </property> </bean>
2) For dynamically generated menu items, you could substitute the globalNavBar bean by replacing it with your custom navBar implementation in the spring.xml file in your custom plugin. This custom navBar Implementation would need to extend com.jivesoftware.community.navbar.impl.GlobalNavBarImpl. You can then override that navBar's setLinks method and (for example) add your additional menu items before calling setLinks on super.
We're also wanting to do some theme manipulation here - is it possible to control these elements through the FTL, or does it need to be a core java change?
Depending on the level of manipulation, you may be able to do it with JS/CSS; however, there are use-cases where the core Java elements are needed. This topic has been discussed more recently, How to: Add a Tab to a Place . While this isn't a NavBar Button...all the steps are relevant and relate. This information plus Andreas Ley post above should get you in the ballpark. Let me know if there are still questions. =)
Thanks, Ryan - this is good stuff!