Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

TinyMCE


René H4

Recommended Posts

11 minutes ago, Heatherbell said:

Sorry for my bad Nederlands

Probably translating "It's OK" to Dutch "Het's goed zo" is not bad.

I understand. "Het's goed zo" is usually interpreted like "It's OK" or "I'm OK with it" in a means of "I no longer wish to discuss..." 🙂

 

Just installed it, and it gives a much better response that my currenr bootsrapped Frozen admin (no offence to anyone).

 

 

 

Link to comment
Share on other sites

I'm pretty sure it's possible with no core changes, in Phoenix. 

I think older versions of CE (and certainly all flavours of 2.3.4.1 and older) would need core code changes.

Who's going to have a go at a no core code change TinyMCE implementation ?

Link to comment
Share on other sites

Done a little bit of it.

Getting the code added to the admin.

Using the admin hook.

Just can't work out how to target specific textareas.(could only see name, no I'd or class)

Or would it be better to just include it in all textareas?

Phoenix support now at https://phoenixcart.org/forum/
App created for phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

2 hours ago, burt said:

I'm pretty sure it's possible with no core changes, in Phoenix. 

 

it is possible with all as long it contain an identifier like a class or ID, or as in your example the name element.
The problem with the name element is that you must list them all, so the editor fires.

a wysiwyg is most used:
- products descriptions.
- categories descriptions.
- manufacturers descriptions.
 

Addons what let you edit:
- privacy.php.
- shipping.php.
- conditions.php.
- * other information pages.

Link to comment
Share on other sites

just managed it.

it only loads on the selected textareas e.g. product description and category description.

if using multiple languages, you would need to make a small edit to the file to use tinymce with those languages. 

due to how the name of each field works ( it includes a number)

 

Phoenix support now at https://phoenixcart.org/forum/
App created for phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

6 minutes ago, burt said:

The code I posted should target all "product_description", regardless of the number in square brackets...

got it working,

for some reason all the other config i used ' and on that line i used "

Phoenix support now at https://phoenixcart.org/forum/
App created for phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

this is what i managed to achieve.  With my first attempt at using the hook system

i'll possibly tidy it up a bit on Sunday. and upload it as an addon

basically it just works just like the hooks on the shop side.

works on all category description, and product descriptions  textareas, regardless of how many languages you use.

in regards to the themes / plugins / toolbar you can just add / remove them as you see fit (the settings you see in the file are the ones i use myself)

it does with work the tinymce CDN (if you got an API KEY), loading locally, or via another CDN (using an CDNJS just to show it works),  you can use whatever source you want.

the same basic idea can also be used for ck editor, or any other javascript library you think you may need within the admin.

 

 

tinymce hook.zip

Phoenix support now at https://phoenixcart.org/forum/
App created for phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

9 hours ago, kgtee said:

Ckeditor should be a better choice as it supports bootstrap tabs editing.

Ckeditor (or any other scripts) can be added into the admin using the same method that I used.

Not sure how ckeditor manages it but you can add in any external stylesheet into tinymce. Like I did with the bootstrap css

 

Phoenix support now at https://phoenixcart.org/forum/
App created for phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

Excellent work @puddlec - loads of people will be very happy with this!

There is one small change I'd potentially make;  add in an array of good pages such like;

var $good_pages = ['categories.php', 'manufacturers.php'];

and then in the function, global $PHP_SELF and check it against the good_pages;

if (in_array(basename($PHP_SELF, $this->good_pages)) {
  ...
}

This will then load the scripts only on the pages that need them rather than on all pages.

And add textarea[name^="manufacturers_description"] to the selector (for manufacturer descriptions).

Note:  untested!

Link to comment
Share on other sites

1 hour ago, burt said:

Excellent work @puddlec - loads of people will be very happy with this!

There is one small change I'd potentially make;  add in an array of good pages such like;


var $good_pages = ['categories.php', 'manufacturers.php'];

and then in the function, global $PHP_SELF and check it against the good_pages;


if (in_array(basename($PHP_SELF, $this->good_pages)) {
  ...
}

This will then load the scripts only on the pages that need them rather than on all pages.

And add textarea[name^="manufacturers_description"] to the selector (for manufacturer descriptions).

Note:  untested!

Thanks for that, I'll add it in.

Phoenix support now at https://phoenixcart.org/forum/
App created for phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...