Hello!
This is (yet another) FTL question for SBS 3.0.0. I have customized the "Your Stuff" menu with a link to the user's personalized homepage. However, I would like to retain the "#if hasPersonalized" conditional. What do I need to add to the string to make it look for the property?
Original code from main.ftl:
<a href="<@s.url value='/index.jspa'/><#if hasPersonalized>?showpersonalized=true<#else>?showpreview=true</#if>"><@s.text name="main.filterview.your"/></a>
The issue is that when the menu is viewed on other pages, the linked url terminates in index.jspa.
Please let me know if I can clarify.
Thanks,
Rebecca
Hey Rebecca,
How have you gone about to customize the "Your Stuff" menu exactly? Also, are you saying that when you view any other page except for the main page you see only index.jspa in the link? and not index.jspa?showpersonalized=true or ?showpreview=true ?
-Todd
Todd,
I customized the "Your Stuff" menu by adding the following item to the renderToolbox macro in user-bar.ftl:
<!-- LINK TO PERSONAL HOMEPAGE -->
<#if !user.anonymous>
<li><a href="<@s.url value='/index.jspa'/><#if hasPersonalized>?showpersonalized=true<#else>?showpreview=true</#if>"><span class="jive-icon-med jive-icon-homepage"></span>Home Page</a></li>
</#if>
And yes, with this code in place, when I mouse over the item in the menu on any page besides either the default or personalized homepage, the url ends in index.jspa, without either modifier.
Hey Rebecca,
Instead of that approach, I would highly suggest trying to do this with a simple plugin. All you need to do is create one which has a plugin.xml where you define your custom items for the tab and then you can apply modifiers to it to only display when certain evaluations are true:
http://www.jivesoftware.com/jivespace/docs/DOC-3282
http://www.jivesoftware.com/jivespace/docs/DOC-3432
Let me know if you have any questions.
-Todd
Todd,
To be honest, I'm a designer, not a developer; creating an entire new plugin to insert a single menu item is a larger-scale solution than I'm accustomed to. Is this approach recommended in case we wind up needing to add more than one menu item down the road? Would we have a single plugin for all added actions/menu items, or would we have to create a new plugin for each addition?
R.
Hey Rebecca,
Definitely. It also means that any updates we make to the user-bar or related FTL's will not be hindered by a theme customization (making patch releases much more pain free).
You could have a single plugin. All you'd need is the plugin JAR with a plugin.xml inside of it. We have some example plugins available here that should help as well:
https://svn.jivesoftware.com/svn/dev/repos/jive/
Let me know if you have any questions. Thanks!
-Todd
Jive combines collaboration software, community software & social networking software into the leading SBS solution.
© Copyright 2000–2009 Jive Software. All rights reserved.
915 SW Stark St., Suite 400, Portland, OR 97205