X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Adding the FCKeditor HTML Editor (https://forum.x-cart.com/showthread.php?t=29771)

rayjohnson 05-04-2009 07:49 AM

Re: Adding the FCKeditor HTML Editor
 
Hi Vetrievel...how did you add the editor to your textarea.tpl? That would fix my issue with the xtended tabs....

Thanks,
Ray

Charon 08-14-2009 01:29 PM

Re: Adding the FCKeditor HTML Editor
 
Thanks phil I have this working for the most part but using the newest version of fckeditor and 4.2.2 I get this error in the resource browser

Error creating folder "redirect:/dispatcher.php/" (Can't create redirect: directory)

all the other functionality seems to be correct and working. Has anyone else come across this. It's not a big issue since they don't need the resource browser but it would be handy functionality.

Thanks for any thoughts!

PhilJ 08-14-2009 02:04 PM

Re: Adding the FCKeditor HTML Editor
 
Charon, hmm, maybe try creating a new directory in the store root named 'userfiles'. Then make it writable (CHMOD 777)

Charon 08-14-2009 04:06 PM

Re: Adding the FCKeditor HTML Editor
 
Phil,

I already have the directory and its writeable. I think it has something to do with where it wants to start the resource browser (maybe like a default start point) that is not there I have looked at dispatcher.php but that seems to be not the problem. I will have to dig into it a little deeper. But thank you so much for the whole idea since I was going to have to write a php solution to non-ftp-centric users for the ability to add images to the site and use them in the variables and static pages. Whew saved me HOURS of work!!!! 8O

Thanks again :D

Charon 08-14-2009 04:17 PM

Re: Adding the FCKeditor HTML Editor
 
phil,

Also FYI, I noticed also that in 4.2.2 if you use this on the languages page in admin you will get a <TEXTAREA> empty error unless you enclose the <script> in {if $smarty.get.language ne ""}...{/if} statement. This seems to stem from the fact that the default language is not loaded into the select box at the top of the page even if you have a default language displayed. Don't know why it doesn't load and select the language you have as default but no biggie this will work around that little issue.

Charon 08-21-2009 06:29 AM

Re: Adding the FCKeditor HTML Editor
 
Phil,

I noticed something about using the fckeditor on the system, if you use the editor on all the language variable boxes, which does slow down the load considerably, it encloses plain text in either <p>, <div>, or <br> so this can have some ill effects. Take for example you open the languages page and select your language, it loads the page and diplays the first x number of variables. Now since fckeditor starts in wysiwyg mode, you don't notice that it has enclsoed all of the plain text in the first x variables inside tags. Now if you just edit one of those first variables and go to the bottom and click update all (why isnt it update selected anyway?) it has now updated all of the first x variables with the tags. So then if in your css you have the base <div>, <p>, or <br> tags with any styles on them, those styles now overwrite the styles you might have intended for these variables.

I took a look in the editor config and it doesn't seem to allow you to turn that feature off, just change what it is enclosing them in.

Just thought it was worth noting.

@ashley
you can get it working in the webmaster mode but it takes a lot of finagling to get it not to blank out the text in the textarea, kinda strange behavior.

Primordial Performance 08-25-2009 11:40 AM

Re: Adding the FCKeditor HTML Editor
 
This might be slightly off-thread-topic, but related enough that I bet someone here has the answer at hand.

I've created some custom pages in the admin area to add new page types, using tinymce editor for the main field. Only problem is that HTML is being deleted. Does anyone know where in xcart the HTML is stripped out of form fields so that maybe I can code in an exception for my own stuff?

The pages in question are for editing simple "pages"...I include:
require "./auth.php";
require $xcart_dir."/include/security.php";
...but the code is otherwise all my own.

webeditors 09-10-2009 09:54 AM

Re: Adding the FCKeditor HTML Editor
 
I'm having a problem uploading images using fckeditor. If I try to upload an image from my computer it just hangs forever, and if I try to browse to the server, i get this error message:

The requested URL /ckfinder/ckfinder.html was not found on this server.

Any ideas?

Vetrivel 09-10-2009 07:24 PM

Re: Adding the FCKeditor HTML Editor
 
Have you provided the right path in the CONFIG file inside the FCK editor folder.
PHP Code:

fckeditor/editor/filemanager/connectors/php/config.php 

.



Quote:

Originally Posted by webeditors
I'm having a problem uploading images using fckeditor. If I try to upload an image from my computer it just hangs forever, and if I try to browse to the server, i get this error message:

The requested URL /ckfinder/ckfinder.html was not found on this server.

Any ideas?


benz 09-27-2009 11:02 PM

Re: Adding the FCKeditor HTML Editor
 
The latest release of FCKeditor has been renamed to CKEditor, its a nice upgrade from the old one - one nice feature is that the textarea by default is resizeable, so passing in height and width parameters to the editor instance isn't always needed anymore.

When installing it the invocation process has changed a little bit. Follow the instructions at the start of this thread for downloading and installing on your server, using ckeditor instead of fckeditor for filepaths.

Now when you want to turn a textarea into an editor the javascript is different - there are 2 ways you do this.

1. Similar to the original method, insert some javascript after the textarea but with a new syntax eg for the skin1/main/product_details.tpl changes you would now use
Code:

{if $active_modules.FCKEditor ne ""}
<script type="text/javascript">
CKEDITOR.replace('descr');
CKEDITOR.replace('fulldescr');
</script>
{/if}

You can also customise the editor as you call it, read this article for more http://docs.fckeditor.net/CKEditor_3.x/Developers_Guide/Toolbar

2. Add the "ckeditor" class any text area you want to use as an editor. This is my preferred method, you can either edit the textarea.tpl file to always have this class, or just add it in for only the textareas that need it (which is what I do, it can be a bit dangerous adding it everywhere!). To add it in just to the full description field on a product page look in skin1/main/product_details.tpl for this line
Code:

{include file="main/textarea.tpl" name="fulldescr" cols=45 rows=12 class="InputWidth" data=$product.fulldescr width="80%" btn_rows=4}

and add in the ckeditor class as follows
Code:

{include file="main/textarea.tpl" name="fulldescr" cols=45 rows=12 class="InputWidth ckeditor" data=$product.fulldescr width="80%" btn_rows=4}

WARNING: Ckeditor is still in its early days, one feature that doesn't yet work out of the box with this new version is the image/file uploading - from what I can gather this is scheduled for release around December 2009. In the interim if you want to upload images with the new version you can purchase a plugin from them or write your own upload script for it. I think I'll be waiting :-)


All times are GMT -8. The time now is 03:22 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.