How do you upload images directly into TinyMCE?

I love elgg but there is something that I cannot do with it that makes me want to delete it and give up. 

I need a Tiny MCE (full features) so I can edit my pages the way I like and I also need that when I want to insert an image, I can get it from my computer and not have to enter a URL to get it. It's not convenient at all. 

So far I  have found plugins that could do one but not the other. I have tried several configurations of different plugins and still cannot get it to work the way I need it to work. Any suggestions on  how I can have a full Tiny MCE with the possibility to upload images from my computer? 

  • if you can write code you can do this and anything you want if you do please release to elgg! I actually like the style we have now because we do not have to host the files images etc helps a lot in many ways though your method is needed for some people i prefer the method we have now even though it is annoying for some people it saves the site owners money

  • But I cant ask people to create groups if I have to teach them on how to get an image from somewhere else on the web. That is why I need it. Bandwidth for now is not a problem.

  • i see if you can not make yourself join the group here where you can hire people : ) please release plugin if you get it made for you

  • Elgg TinyMCE plugin with more features enabled compared to the default TinyMCE plugin: http://community.elgg.org/plugins/782028/4.0.12_r30/elgg-1819-extended-tinymce. If you need even more features you can configure the TinyMCE options to be loaded in the init function of TinyMCE.

    Regarding uploading of images: you can upload images from your local computer and embed them in postings without providing an url by using the bundled embed plugin. You can upload / embed images by clicking on the "Embed content" link above the TinyMCE editor. For this to work both the embed and files plugin need to be enabled. The images will then be uploaded to the files section of your site and you can embed any image either immediatelly or at a later time.

    Using the embed plugin has the advantage that it's safe, because only valid users of your site will be able to upload images and they are saved in the data directory where no one has direct access to the files. The disadvantage is that the images only meant to be embedded once will still be visible in the files section.

    There exist file / image uploader plugins for TinyMCE. You can add such plugins to the plugin folder within the TinyMCE source folder of the TinyMCE Elgg plugin used and enable / configure the uploader plugin in the init function of the editor like the other TInyMCE plugins already used. But using such a TinyMCE uploader plugin will not know about the Elgg access levels if you don't modify it accordingly. By default, the images will only get uploaded to a folder to be created within the document root folder. This means that anyone even without being a user of your site could access these files if knowing the url.

    There's a rather simple uploader plugin available at http://justboil.me/. Configuration is rather simply: copy this plugin into the plugin folder of TinyMCE, create an upload folder, provide the path to this folder in the settings file and add this plugin and its toolbar button in the TinyMCE init function. Then everyonce can upload images files from their computers. Like I said, not very Elggish. If you want to be the only one to be allowed to upload files, you could password protect the upload as described on the justboil.me site. I'm pretty sure there are other similar TinyMCE upload plugins available that might offer even more features. You just need to do a little search and try them out. Still, I would rely on the bundled Elgg embed plugin to provide the option of embed images in postings personally.

  • Where do I find the "TinyMCE init function" ?

  • The init function is in mod/tinymce/views/default/js/tinymce.php or mod/extended_tinymce/views/default/js/extended_tinymce.ph respectively.

  • Ok. My decision is made. I am giving up on elgg. I cannot understand for the life of me why a TinyMCE does not already have the option to upload pictures from one's computer. In reading the responses, it seems easy, yet nobody has created that plugin. Am I suppose to know what to put in the TinyMCE init function? Wordpress as all I need except for groups, I could live without it. Thanks for the help, but I can't pass hours at a time trying to figure something out when I can be building my site instead.

  • Wordpress and Elgg are different things. With Wordpress you are more likely the only one (or it might only be a few persons) who publishes content. With Elgg everyone can publish content. Therefore, securing the server, handling of access rights etc. result in very different approaches for certain things.

    As I mentioned you can embed images into postings using the Embed plugin that is included in the Elgg core bundle. It allows you to host the images on your server and there's no need to copy+paste any urls to embed images. The only thing is that you have to embed the images via the Embed content link instead of the "Insert/edit image" button.

    Tinymce also has addons to allow for uploading of images. I linked one in my former posting. But this upload addon won't be integrated in the Elgg framework but will require a separate upload folder to be created.

    But if Wordpress suits your needs then it's likely that you don't aim on building a social network site anyway. If it meets your requirements better, then use it...

  • I found out how to simply copy/paste images in content and suggested it as a Elgg core change. Unfortunately, the change did not make it because of security concerns, which are valid from a core development perspective.

    Adding files directly into TinyMCE also imposes a risk, so such a change will probably also never make it to core.

    Changing to wordpress from elgg without a good understanding what you are doing might be tempting from a functionality point of view, but if you want to run a professional social network there is really more to it than just getting what you demand. Good luck !