Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi there,


Hi there,

I've read the following thread : viewtopic.php?f=4&t=7721

I've successfully set up the edit forms and create new page forms for my "front end". My only question involves setting up the richtext editor to use in editing a richtext editable region.
KK wrote: The only catch is that those regions that have no cms:input counterpart (e.g. richtext, nicedit, relation, repeatable etc.) depend on their specific CSS/JS and other assets to work correctly.
If we can manually add the required assets to the front-end template, we can use those without a problem.

Addressing specifically the richtext type, it'd require adding the following line in your template (just below the <?php require_once( 'couch/cms.php' ); ?> statement)
Code: Select all
<?php require_once( K_COUCH_DIR.'includes/ckeditor/ckeditor.php' ); ?>




I've added the ckeditor line to my pages, that's fine and dandy. My only question is about the richtext type. Does it exist, or no? And how can I use it inside my <cms:input type="richtext"... > ??

It keeps telling me

Code: Select all
ERROR: Tag "input" needs a 'type' attribute


This is my code for the richtext area

Code: Select all
<cms:input type="richtext" name='main_content' />


As you mentioned above, there is no richtext type natively for input tags, how would I go about manually using the ckeditor to both render content in it for editing and allow richtext editing of the content itself?

I know you advise against editing on the front end because currently there is no way to track user actions, but the client is not worried about that functionality nor does he distrust any committee members to be editing things they shouldn't (added on top of the functional usergroups mod you've helped me with!)


EDIT : DELETE THIS THREAD, I overlooked the bound part of the form.
Now that I made my simple corrections and this is all going smoothly, I was just wondering, in the ckeditor (richtext editor), how does a client add custom HTML Code? Say in the future they want to add a paypal snippet or another custom html addition to the site inside of the rich editor?

I've tried in the source view option of the editor using simple <img> tags to try with images I have both local to the web page and from other web pages, but it completely strips the code out.
I've used the source code editor in richtext fields and sometimes it works, especially for simple modifications, but it can be fussy and doesn't always cooperate.

Couch uses shortcodes (http://www.couchcms.com/docs/miscellane ... codes.html) for embedding snippets of code into the richtext editor. The documentation gives a thorough explanation of the process and includes examples of shortcodes for a number of specific purposes like youtube and flash movies, iframes and obfuscating email. Or you can use an all-purpose shortcode (viewtopic.php?f=8&t=7950) for embedding a variety of code snippets in the richtext editor.
3 posts Page 1 of 1