Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Possible to allow image upload for theme customisation?
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?
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?
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.
Looks like the only way to handle this would be a custom theme per site.
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
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™