Adding images to web UI custom theme
I tried for Web UI Theme customization , I want to insert image into the theme but when I deployed theme on server the image not displayed but Its working on locally.
Can anyone tell me where to store image on server side.?
Here is my HTML image tag code
img src="../img/logo.jpg" width="120" height="60"
Can anyone tell me where to store image on server side.?
Here is my HTML image tag code
img src="../img/logo.jpg" width="120" height="60"
Accepted answer
The proper way to get the resource url is via javascript call.
jazz.util.theming.themeFileUrl("templates/ThemeWidget.html")
I'll update the documentation to better present that specific use case.
My recommendation is to add a JavaScript file to the theme that has the following code :
dojo.require("jazz.util.theming"); // This should already be included in the page, but it's safe to add it.
dojo.ready(function() {
dojo.attr("imageNodeId","src",jazz.util.theming.themeFileUrl("img/logo.jpg"));
});
Note that the url passed to that method is a path relative to the root of the theme.
Unfortunately when creating the theme, you don't currently have enough information to know where the theme is located. In particular, several of our applications proxy theme requests back to the JTS, which may be deployed on another machine.
Comments
Sudeshna Mitra
Aug 22 '12, 4:46 a.m.Let me know the location where uploaded themes are stored.
Joel Lonneker
Sep 13 '12, 6:56 p.m.Deleting this comment