| Title | Personal Favorites in the LeftMenu |
| Date | 10-Sep-2005 22:29:24 EEST |
| JSPWiki version | any |
| Submitter | DirkFrederickx |
| Idea Category | TemplateIdea |
| Reference | |
| Idea Status | NewIdea |
The LeftMenu is a good place for frequently used links. However, your favorites places in your wiki may differ from person to person.
This Idea proposes a convention for a Personal Favorites wiki page, starting with your UserName followed by ~Favorites: like [DFFavorites]
This convention would allow JSPWiki to include this page in the LeftMenu as soons as the user authenticated himself.
Here is some JSP code you can add to the LeftMenu to do the trick.
<%-- div class='myfavorites' --%>
<wiki:UserCheck status="known">
<%
WikiContext c = (WikiContext) pageContext.getAttribute( "jspwiki.context",
PageContext.REQUEST_SCOPE );
String username = null;
try {
username = c.getEngine().getVariableManager().getValue(c, "username" );
} catch( Exception e ) { /* dont care */ }
if( username == null ) username = "";
String myFav = username + "Favorites";
%>
<wiki:PageExists page="<%= myFav %>">
<div class="myfavorites">
<wiki:LinkTo page="<%= myFav %>" >My Favorites</wiki:LinkTo>
<wiki:InsertPage page="<%= myFav %>"/>
</div>
</wiki:PageExists>
</wiki:UserCheck>
--DF
Sounds like good idea !
And similar: how about a personal "StartPage" , if you go to your wiki, you get your own StartPage (actually a page that's named <YourWikiName>StartPage, instead of the systemwide default. Offcourse only if you are asserted or logged in, and you have a personal StartPage defined.
Harry
--HarryMetske, 24-Sep-2006