If you wish to provide CSS editing via Couch and want to have a nice syntax highlighter then download the attached addon based on codemirror and call in into a message field as per the code below. Note the ID is "f_code" if you called your textarea for the CSS "custom_css" then you'd need to modify the following line to your field name with the f_ prefix:
For more information on front end stylesheet editing see this thread: - go down to KK's approach 2/3rds down the page
viewtopic.php?f=8&t=7371
var editor = CodeMirror.fromTextArea(document.getElementById("f_prefixed_textarea_name"), {});
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:content_type 'text/css' />
<cms:template title='Style'>
<cms:editable name='codemirror' type='message'>
<style type="text/css">
.CodeMirror {border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc;}
.CodeMirror-activeline-background {background: #eeeeee !important;}
</style>
<link rel="stylesheet" href="<cms:show k_couch_link/>addons/codemirror/lib/codemirror.css">
<script src="<cms:show k_couch_link/>addons/codemirror/lib/codemirror.js"></script>
<script src="<cms:show k_couch_link/>addons/codemirror/mode/css/css.js"></script>
<script src="<cms:show k_couch_link/>addons/codemirror/addon/selection/active-line.js"></script>
<script>
window.addEvent('domready', function(){
var editor = CodeMirror.fromTextArea(document.getElementById("f_code"), {});
});
</script>
</cms:editable>
<cms:editable name='code' label='CSS Code' type='textarea' />
</cms:template>
<?php COUCH::invoke(); ?>
For more information on front end stylesheet editing see this thread: - go down to KK's approach 2/3rds down the page
viewtopic.php?f=8&t=7371