Expand my Community achievements bar.

Logo component losing image

Avatar

Former Community Member

Hello, I created a logo component and JSP file is like this :

 

<%@include file="/libs/wcm/global.jsp"%><% %><%@ page import="com.day.text.Text" %><% long absParent = currentStyle.get("absParent", 2L); String home = Text.getAbsoluteParent(currentPage.getPath(), (int) absParent); Resource image = currentStyle.get("image", Resource.class); %><a href="<%= home %>.html"><% if (image ==null) { %>Home<% } else { %><img border="0" src="<%= image.getPath() %>" alt="Home" ><% } %></a>

 

But the image which I upload for logo does not stay there. When I sigh out of instance and then sign in again that image will go off.

4 Replies

Avatar

Level 2

Is the image present in CQ DAM or in your local machine.

Just check the JCR property of the path to find which location it is referencing. Debug this way, May be you might find a solution. Happy coding :)

Avatar

Former Community Member

I was trying to upload image from my local drive. I have not added it to repository.

Avatar

Level 5
Level 5

Priyanka_NewToAEM wrote...

I was trying to upload image from my local drive. I have not added it to repository.

 

Local images will not be available if you move your code base to another environment. so Please upload the images into DAM and use it.

Regards,

Var