by
KK » Tue Aug 04, 2015 12:36 am
@tim, you are thinking on the right line. However, the way you are using the 'message' region will only literally inject the Couch tags inside the edit screen (i.e. will not execute those tags).
The correct implementation would be as follows -
- Code: Select all
<cms:editable name='hide' type='message' dynamic='default_data'>
hide.html
</cms:editable>
You'll also need to create a snippet named 'hide.html' and place it in your couch/snippets folder.
Place the following within the snippet -
- Code: Select all
<cms:if k_user_access_level lt '10' >
<style>#advanced-settings{display:none;}</style>
</cms:if>
Now the contents of the message region are dynamic - every time the edit page is accessed, the region tries to find a snippet named 'hide.html', execute it and inject the content returned by the snippet in the admin-panel.
You can find this technique being used to conditionally inject JavaScript in the admin-panel -
viewtopic.php?p=7068#p7068Hope it helps.