How easy is it to move "Comment" to a tab of it's own?

View: New views
2 Messages — Rating Filter:   Alert me  

How easy is it to move "Comment" to a tab of it's own?

by Gavin Goldsmith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi all

To make JSPWiki more accessible to seemingly "less technical" users; how
easy is it to move the "Comment" tab from the "More..." tab to a tab of
it's own?

We're currently on 2.6.0 though I'm hoping to move us to 2.6.3 as soon
as time allows...

Thanks

Gavin

Read our disclaimer at: http://www.picknpay.co.za/pnp/view/pnp/en/page5093?
If you don't have web access, the disclaimer can be mailed to you on request.
Disclaimer requests to be sent to it-security@...
 

Re: How easy is it to move "Comment" to a tab of it's own?

by Janne Jalkanen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> To make JSPWiki more accessible to seemingly "less technical"  
> users; how
> easy is it to move the "Comment" tab from the "More..." tab to a  
> tab of
> it's own?

Not very difficult.  Here are the detailed steps to do it:

First, we'll create a custom template for you so that upgrades don't  
screw you:

1) Create $wikihome/templates/mytemplate

2) Copy $wikihome/templates/default/PageActionsTop.jsp to $wikihome/
templates/mytemplate

3) Set "jspwiki.templateDir = mytemplate" in jspwiki.properties.

JSPWiki will now use mytemplate/PageActionsTop.jsp whenever it can,  
and will default to whatever it can find in your default template for  
the rest.

4) Add the following lines in PageActionsTop.jsp, between the <ul>  
and </ul> tags.

     <wiki:CheckRequestContext context='view|info|diff|upload'>
     <wiki:Permission permission="comment">
     <li>
         <wiki:PageType type="page">
           <a href="<wiki:Link context='comment' format='url' />"  
class="action edit"
             title="<fmt:message key='actions.comment.title'/>"  
 ><fmt:message key='actions.comment'/></a>
         </wiki:PageType>
     </li>
     </wiki:Permission>
     </wiki:CheckRequestContext>

What this essentially means that "whenever user is viewing the page,  
or looking at the page info, or checking the difference between pages  
or is doing an upload (the CheckRequestContext); check whether the  
user may comment on this page (the Permission); then check if this is  
a WikiPage (as opposed to an attachment); then add a new tab with a  
comment link.

The tabs are actually list items <li>.

/Janne