It's all about the answers!

Ask a question

Adding images to web UI custom theme


0
1
Sudeshna Mitra (2332831) | asked Aug 22 '12, 1:06 a.m.
edited Aug 22 '12, 1:28 a.m.
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"
  

Comments
Sudeshna Mitra commented Aug 22 '12, 4:46 a.m.

Let me know the location where uploaded themes are stored.


Joel Lonneker commented Sep 13 '12, 6:52 p.m. | edited Sep 13 '12, 6:56 p.m.

Deleting this comment

Accepted answer


permanent link
David Boyer (812) | answered Sep 14 '12, 12:02 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
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.
Ralph Schoon selected this answer as the correct answer

Comments
David Boyer commented Sep 14 '12, 12:12 p.m. | edited Aug 19 '16, 9:48 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

 The documentation has been updated on the Wiki here

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.