Jump to content

InputfieldImage as Config Option


Recommended Posts

Can images be used as configuration options in modules? I'm trying to develop a module and I'd like the option to set an image to use, but so far I haven't had any success.

 

Currently the images I upload to test are declared invalid (the debugger doesn't show a width so it throws an exception). SVG files work, but nothing is stored in the data value of the config field (returns an empty array). I've set the upload directory to a new directory inside assets and the images are uploaded, but not unlinked when image fails.

 

Am I trying to do something that's not going to work? I feel like I'm close but can't seem to figure out what's missing.

 

Thanks,

MadHatter

Link to comment
Share on other sites

14 minutes ago, Macrura said:

the way to do it would be to have the module create template/field/page to hold the image(s), and then in the module, reference that page..

Oh yeah, good point. I'll probably do that then.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...