RE: Possible to allow image upload for theme customisation?

Mark Clarke, modified 6 Years ago. Regular Member Posts: 107 Join Date: 3/3/12 Recent Posts
Hi all,

I am creating a theme that will be used on several sites and I would like to enable users to change themes background image as well as background iimages in a layout template. Ideally they user shold be able to upload new images and then browse for them or provide the image name so they can be used in a programmatically generated url.

From what I have read so far this does not sound possible. I know about "settings" at the theme level, not sure what is available at a page level, but this does not have a "file" type.

Any suggestions or work around?
Mark Clarke, modified 6 Years ago. Regular Member Posts: 107 Join Date: 3/3/12 Recent Posts
It appears it is not possible to make a theme dynamic with respect to images. You can use theme settings for text based configuration but uploading replacements images etc is not supported. I did look at writing a admin panel app to allow for the upload of pictures but couldn't find a way to get the image path of the target site's (non-admin) theme. The idea was to allow for the uploading of images to replace the images used by the theme and the admin plugin would simply copy the pictures over those of the theme. Another problem is that the theme image directory appears t be  shared by all sites using the theme.

Looks like the only way to handle this would be a custom theme per site.
thumbnail
Fernando Fernandez, modified 6 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts
Mark ClarkeHi all,

I am creating a theme that will be used on several sites and I would like to enable users to change themes background image as well as background iimages in a layout template. Ideally they user shold be able to upload new images and then browse for them or provide the image name so they can be used in a programmatically generated url.

From what I have read so far this does not sound possible. I know about "settings" at the theme level, not sure what is available at a page level, but this does not have a "file" type.

Any suggestions or work around?

I would suggest that you use a theme setting to store the background image url and then use it on the theme's base template.

HTH

​​​​​​​Fernando