2

I have a Channel Form for users to submit content. They need to be able to upload images, and then in a RTE editor (e.g. Description field) be able to click the Insert Image button but only see the images they have uploaded. They cant be able to see other peoples images of course.

Initially we tried Dev Demon's Channel Images. This would actually suit our needs, but it has unresolved rendering issues that means its not working right in Channel Form (have reported to the developer).

The RTE Image button I read does not work on the front end only in the CP for some reason, so thats not working.

I cant find any information on a Pixel & Tonic Assets button for the RTE, I dont think there is one.

So aside from the above, how would one offer members the ability to upload their own images to the site and insert them into a field in Channel Form, but only seeing their own images?

Thanks

2 Answers 2

2

I'm not aware of any solutions on how to limit to only show current users images, however with Assets, you can just use the file input field instead of the full Assets field:

<input type="file" name="assets_field_name">

If you want further control on where the file is uploaded, then just add a hidden field for the upload directory:

<input type="hidden" name="assets_field_name_filedir" value="1">

Make sure the name= of the hidden field is your Asset field name suffixed with _filedir

This would at least only allow uploads–the only downfall is users won't be able to browse images. Then within your template, you could use a find & replace technique like this for the users to input {image_1} in the RTE field to position the image where they want. Depending on how much control you want them to have, you may need to add a couple other fields for position, size, etc.

Note: This could also be done with the native file field.

Or, even better, just upgrade the RTE field to a 3rd Party WYISWYG that allows file uploading.

Sorry for the run on answer

1
  • thanks a lot for that detailed answer... but it all sounds a bit tricky how to get a Insert Image button in an editor, without using another one that is. I have actually fixed the Channel Images issue, and will post about that Jan 3, 2014 at 14:37
1

I have actually now fixed the DevDemon Channel Images issue, and so we are going to use that, we could not find an alternative way of doing this easily.

In fact, it was not an issue with Channel Images as I thought, but an issue with EE/RTE and JQuery...

We were using our own JQuery version, one of the latest ones. If I removed this, and EE inserted its own Jquery (which is version 1.7.2!), then Channel Images works.

It was not only Channel Images pop up that broke, but the RTE Insert Hyperlink pop up.

So it seems the RTE pop ups require Jquery version 1.7.2 and no later. I tried it with versions 1.8.x and above and they all broke the RTE pop ups.

So my answer is not specific to the question, but fixing this issue does mean that we can use Channel Images which does allow us to do what we want!

Shame we have to resort to JQuery 1.7.2, I am going to have to test all our other JQuery functions and plugins now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.