Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi ... just wondering in the age of Couch2 if the method for hiding an editable region would still be this one https://www.couchcms.com/forum/viewtopic.php?f=2&t=5503&hilit=hide+editable+from+admin? I've tried using that method and can't get it working ... maybe there is something to be done with <cms:config_form_view>, but can't figure out what! Thanks ...
If hiding the field with CSS is enough, you can use config_form_view.
Code: Select all
    <cms:config_form_view>
        <cms:if k_user_access_level lt '10'>
            <cms:style>
                #k_element_my_editable{display:none;}
            </cms:style>
        </cms:if>
    </cms:config_form_view>
thanks @tim - for some reason that didn't work for me ... logged out and back in as admin etc.
The following should work (needless to say, you should place the correct element ID in there)
Code: Select all
<cms:config_form_view>
    <cms:style>
        <cms:if k_user_access_level lt '10'>
            #k_element_my_editable{display:none;}
        </cms:if>
    </cms:style>
</cms:config_form_view>

Visit the template as super-admin for the config to be saved.
Now in the admin-panel, do a view-source and you should see the <style> tag block containing the CSS rules you specified.

Hope it helps.
great thanks! very useful
5 posts Page 1 of 1