elfuchsjekyll / vosao

Automatically exported from code.google.com/p/vosao
0 stars 0 forks source link

In-line editing for authenticated users #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A common CMS feature is to provide a link to authenticated editors to make
it easy to edit a page. 

One (hard) way to do that with Vosao is to add this code to the page template.

<!--[CDATA[
<%@ page import="org.vosao.business.CurrentUser" %>
<%@ page import="org.vosao.entity.UserEntity" %>
<%@ UserEntity user = CurrentUser.getInstance(); %>
]] -->  

<!-- Rest of page, or "include" page for a common footer -->

<!--[CDATA[
#set($editor=0)
<% if (user.isUser()) { %>
#set($editor=1)
<% } %>
]] -->  
#if($editor==1) 
    <div id="edit_link">
        <a href="/cms">Edit this page</a></div>
#end
</div>

(The CDATA statements are required by ckEdit.) 

Is there an easier way to do this, perhaps with the Velocity Tools?

On a related note, would it be possible to expose SiteMesh to site editors,
or must SiteMesh be reserved for CMS workarea use? 

Original issue reported on code.google.com by ted.husted on 31 Jan 2010 at 3:41

GoogleCodeExporter commented 9 years ago
Actually, the code given in the initial comment doesn't work. But, the question
remains whether the UserHelper could be used to determine if someone is logged 
in,
and then provide an edit link. 

A followup question would be whether we can provide a direct link that would 
open up
ckEdit to the correct page. 

Original comment by ted.husted on 31 Jan 2010 at 4:51

GoogleCodeExporter commented 9 years ago
Agree this is handy feature. 

I think we can implement it by adding "author bar". It will have css fixed 
position
and always be in the bottom of the screen. 

Direct link to editing page will look like 

/cms/page.jsp?id=xxxxxx&tab=1

Original comment by kinyelo@gmail.com on 1 Feb 2010 at 4:29

GoogleCodeExporter commented 9 years ago
Implemented as top admin panel like in cms admin.

Original comment by kinyelo@gmail.com on 11 Feb 2010 at 7:55