Search code examples
content-management-systemopencms

How to make editable menus with OpenCms


How to make editable menus with OpenCms. I want when user clicks on edit button then he can change anything with menu - menu label, Link URL, he can add/del an item from sub-menu list etc.


Solution

  • You can put a <cms:editable/> tag in your JSP, so when the user un logged in, he will see the OpenCMS editable icon (blue, white and red circle). You must put the cms editable tag anywhere at the beginning of the page. Then, you mark your content tag (<cms:include>, <cms:content>, etc.) as editable, with editable atribute.

    Example:

    <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
    
    (things here...)
    
    <cms:editable/>
    
    (more things here...)
    
    <cms:contentload collector="allInFolderDateReleasedDesc" param="<%=url%>" editable="true">
    (content html...)
    </cms:contentload>
    
    <cms:contentload collector="allInFolderDateReleasedDesc" param="<%=url2%>" editable="false">
    (content html...)
    </cms:contentload>
    

    With this, you have one "direct editable" element, and other not editable.

    Hope it helps.

    P.S.: More references in http://www.vinu.edu/cms/opencms/alkacon-documentation/documentation_taglib/docu_tag_editable.html