We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

FF Matrix and TinyMCE ImageManager

Development and Programming

Cody S's avatar
Cody S
5 posts
16 years ago
Cody S's avatar Cody S

Seems pretty simple and I’m sure someone has done it but I couldn’t find a Field Type for it so I am trying to port the LG ImageManager to Field Frame.

I’ve never created a Field Type before but it looked fairly easy considering this one is mainly JS based. Anyways I got it working for the most part with the mcimagemanager.js path hard coded so I didn’t need to mess with config options.

My problem comes when I add a new row. The input name on the new field increases but the JS attached to the imagemanager button doesn’t increase. So the input name on the new field will be something like field_id_4[1][1] yet the JS attached to the button remains at field_id_4[0][1].

This makes the first row change when I select an image in the second row if that makes any sense.

Any ideas how to increment this or does a field type for this exist already? Thanks!

       
sambo's avatar
sambo
80 posts
16 years ago
sambo's avatar sambo

Hi,

this is great news. I have been looking into this myself but had not started yet. As I looked more into it I thought I would just make my own file/image manager instead of using TinyMCE ImageManager. However, this would be just what I need until then.

Are you planing on releasing your field to the community?

Best, Sammi

       
Cody S's avatar
Cody S
5 posts
16 years ago
Cody S's avatar Cody S

Sambo,

Ya it’s always nice to have a visual interface of your photos to select from, even if imagemanager may not be the most useable route to take here. Ngen works great but the ability to create folders and upload is a must for me on this project.

Once I figure this issue out I’ll release it. It’s actually very simple just some JS to add a button that when clicked loads the imagemanager. My issue is that I can’t figure out how to get the $field_name variable to increment when I add a new row so my imagemanager buttons only change the first row.

Any ideas? I’m new to creating extensions and can’t quite figure out how the input fields increment but nothing else does.

       
sambo's avatar
sambo
80 posts
16 years ago
sambo's avatar sambo

Hi,

I will look into this later tonight and see if I can find out how to solve your problem. Yes, some of my clients also request that they can create their own folders 😉

Best, Sammi

       
sambo's avatar
sambo
80 posts
16 years ago
sambo's avatar sambo

Hi,

did you figure this out?

I looked into this and thought it would not be too difficult. But I guess my limited Javascript knowledge is showing because I could not figure it out either. I was trying to manually add Javascript that simply alerted the field name. But I don’t think that works. That will only work for fields that have already been saved - not the ones that are added on the fly.

I think that the solution is to do this similar to what you can see in the nGen File field - that is by using jQuery - because jQuery can find the fields that are added dynamically. Check out that code and see if it helps you.

Best, Sammi

       
sambo's avatar
sambo
80 posts
16 years ago
sambo's avatar sambo

Hi,

I have managed to create a FieldFrame field for MCImageManager and could post it here if required.

It is not production quality but you could possibly use it as a starting point if you haven’t solved your problems already.

I will use it as a starting point for a field for a different filemanager that I am hoping to find. I wan’t a simpler, more elegant filemanager and if I don’t find one that I can use in this field as well as with TinyMCE I will develop one in Flash.

Best, Sammi

       
Cody S's avatar
Cody S
5 posts
16 years ago
Cody S's avatar Cody S

Sambo,

I appreciate all the help. I haven’t had much time to look over this in the past few days. I would love to see what you came up with if you could post it. Did you end up using jQuery or were you able to get it with PHP?

       
sambo's avatar
sambo
80 posts
16 years ago
sambo's avatar sambo

Hi,

I uploaded the code here

Best, Sammi

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.