We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4018
    • 1,131 Posts
    Only reason I haven’t gotten it out yet is because I’ve been backed up with other tasks. As much as I would like to just slap it together and throw it out there, I really think the plugin code for it needs an overhaul. It shouldn’t take too long and (hopefully!) I can get it out real, real soon. Don’t know about a couple of days though...but I’ll try. smiley

    Jeff
      Jeff Whitfield

      "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
      • 27586
      • 31 Posts
      hey ho,

      i guess i am the only one who wants fckeditor 2.4.1 for modx right? ;-)

      /slackstar

        • 22797
        • 134 Posts
        I know that FCKEditor in MODx is built for manager users as a plugin, but is there any way to use FCKEditor to liven up a plain textarea for web users? I’d like something along these lines:

        <label for="message">Message</label>
        [[FCKEditor?&id=message]]
        <input type="submit" name="Submit" value="Submit" />
        


        Where the call to FCKEditor produced a <textarea> element with the fancy rich text editing capabilities. If I can’t do it using FCKEditor, is there another way?
          • 26085
          • 494 Posts
          hi
          I am waiting for fckeditor 2.4.1 too. Because Tiny works with table very bad.
            • 4018
            • 1,131 Posts
            Well...2.4.2 just came out a week ago so I’ll be integrating it with the new release. I’d really like to get it done...hopefully before Monday. Guess we’ll see! smiley

            Jeff
              Jeff Whitfield

              "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
              • 27586
              • 31 Posts
              hi jeff,

              sounds cool - i am really looking forward to monday. ;-)

              /slackstar
                • 4018
                • 1,131 Posts
                Well...Monday came and went...and I’m damn close! Just need a few more tweaks and some testing and I’ll have the first beta out. laugh

                Jeff
                  Jeff Whitfield

                  "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                  • 22797
                  • 134 Posts
                  I’ve created a simple snippet version of FCKeditor. I had to because the web user side of the plugin didn’t seem to be as configurable as the manager user side, and it was getting too frustrating to try to make it work like it was supposed to.

                  I just downloaded the FCKeditor code, put it into a directory in the snippets folder, and gave it some parameters in the snippet. The code is rough and unrefined, but I’ll just paste the whole thing in here, just in case there’s anything useful to you as you work on your own code. Here’s what I have:

                  In the snippet:

                  <?php
                  /* 
                  ###################################
                  The FCKeditor snippet
                  
                  http://wiki.fckeditor.net/Troubleshooting#head-791d6ceba9517cf0b1386179258a4e598c4eb4ff
                  
                  Used to make the FCK rich text editor appear in the place of 
                  a standard <textarea> in a form. Can be used multiple times
                  in the same form
                  
                  PARAMETERS:
                  &base_path = the base path of the fckeditor snippet (default = /assets/snippets/fckeditor/)
                  &name = the name and id of the <textarea>
                  &value = the value to put in the field (can be blank)
                  &toolbar = the name of the toolbar to use (Default | Basic | Custom) The default is Custom (case sensitive)
                  &skin = which skin to use (default | office2003 | silver)
                  &width = width of textarea -- default = 100% (can be percentage or number of pixels)
                  &height = height of textarea -- default = 200px (don't include "px" in this value)
                  ##################################
                  */
                  include("C:/wamp/www/assets/snippets/fckeditor/fckeditor.php") ;
                  
                  // CONFIGURATION:
                  if ($base_path=='') $base_path = '/assets/snippets/fckeditor/';
                  if ($name=='') $name = 'textarea1'; //Note: you MUST specify the field name if there is more than one textarea
                  if ($toolbar=='') $toolbar= 'Custom';
                  if ($skin=='') $skin = 'default';
                  if ($height=='') $height= '200';
                  if ($width=='') $width = '100%';
                  
                  // END CONFIGURATION, BEGIN CODE
                  //&toolbar=Custom&name="+content+"&value="+value+"&skin=default&width=80%&height=600";
                  $oFCKeditor->BasePath = $base_path;
                  //original
                  $oFCKeditor = new FCKeditor($name) ;
                  //new one
                  //$oFCKeditor = new MyFCKeditor($name);
                  $oFCKeditor->Value = $value;
                  $oFCKeditor->ToolbarSet = $toolbar;
                  $oFCKeditor->Config['SkinPath'] = 'skins/'.$skin.'/';
                  $oFCKeditor->Width = $width;
                  $oFCKeditor->Height = $height; 
                  
                  $oFCKeditor->Create() ;
                  
                  $editor = new MyFCKeditor($name);
                  $editor->Value = $value;
                  $editor->ToolbarSet = $toolbar;
                  $editor->Config['SkinPath'] = 'skins/'.$skin.'/';
                  $editor->Width = $width; //BUG: doesn't get the value from snippet call, for some reason
                  $editor->Height = $height; //BUG: doesn't get the value from snippet call, for some reason
                  
                  $editor->returnEditor();
                  ?>
                  


                  To just make the editor show up, you can do this:

                  [!FCKeditor? &toolbar=`Custom` &name=`whatever` &value=`Here is the text.` &skin=`default` &width=`80%` &height=`600`!]  
                  


                  And here’s an example of how it was used in one instance within another snippet (taken out of context, of course, but you can probably see what’s going on:

                  $programedit .= "\t".$modx->runSnippet('FCKeditor',array('toolbar'=>'Custom','name'=>'sdescription','value'=>$_SESSION['sdescription'],'skin'=>'default','width'=>'85%','height'=>'300'))."</p>\n\n";	
                  



                  So there you have it, for what it’s worth. It works. If you can take it and refine it, great. If you can incorporate features like this into the plugin version so that it works equally well for the web user side of things, even better.
                    • 4018
                    • 1,131 Posts
                    Very cool, paulb! Certainly gives me some ideas! smiley Thanks!

                    Jeff
                      Jeff Whitfield

                      "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                      • 27586
                      • 31 Posts
                      thanks a lot jeff - YOU MADE MY DAY! grin

                      /slackstar