General developer forum

I want to upload an image into an admin settings config page

 
Picture of Diane Soini
I want to upload an image into an admin settings config page
 

Is there a workaround for not being able to upload images with the atto editor when using an admin_setting_confightmleditor in my block's admin settings page? I have found through searching that this isn't possible because settings don't have a file area to upload to, so what's the jerry-rigged work-around? Do I have to create a course or a special HTML block somewhere and upload the images there so I can use their URLs or is there something better than that I can do?

Edit: The reason why I want to do it this way is we want to provide a block for instructors that the ADMIN will control what goes in it. We want the admin to be able to change every instance whenever we want to show a different image.

 
Average of ratings: -
Picture of David Mudrák
Re: I want to upload an image into an admin settings config page
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersPlugins guardiansTestersTranslators

If the standard HTML block is not enough for your needs, then you probably want to develop a custom block. That can can define its own file areas and implement the files API properly.

 
Average of ratings: -
Picture of arsen adams
Re: I want to upload an image into an admin settings config page
 

hi all, my name is Arsen)) I am a new member here )) thanks for your post , nice to meet you all here, in this web site, i do not know how to add image...I also want to upload a pic but there is no place to do such action...


 
Average of ratings: -
Picture of Diane Soini
Re: I want to upload an image into an admin settings config page
 

In case anyone comes here looking for an answer, I decided it works well enough to drag an image into the editor. You get an image using src="data:image/png;... instead of a path.

 
Average of ratings: -