⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Set_relation dropdown showing image



nullart
  • profile picture
  • Member

Posted 08 August 2013 - 02:43 AM

How can I show an image in set_relation dropdown?

 

Greatly appreciate your solution guys!

 

Cheers!


davidoster
  • profile picture
  • Member

Posted 08 August 2013 - 06:16 AM

Hello. You mean on the dropdown itself on the list that shows on a per item basis?

E.g. 

<img src=''></img> Item1

<img src=''></img> Item2

Hmmmm. This is interesting!

We need to check on this...


davidoster
  • profile picture
  • Member

Posted 08 August 2013 - 06:18 AM

Well I think the set_relation function won't help you with this!

I believe you need to make your own set_relation by extending the library or make your own model and generate the dropdown yourself programmaticaly along with some js magic.


davidoster
  • profile picture
  • Member

Posted 08 August 2013 - 06:47 AM

Check this, it might help.

https://github.com/djgrant/chosen-image


nullart
  • profile picture
  • Member

Posted 12 August 2013 - 07:46 AM

Thanks for the feedback davidoster. I ended up using callback_field instead. Then manually loading a query inside the callback.

 

For the front end I used this plugin (Im still open to suggestion for a similar type of plugin): http://egg.liam-galvin.co.uk/?p=demo_imagedropdown

 

The idea is create a link to the media table, rather than using field upload.

 

Hope this can be implemented GC.

 

Cheers!