Foros de discusión

Change icons on Login portlet

thumbnail
William Gosse, modificado hace 8 años.

Change icons on Login portlet

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
I want to change the icons for Create Account and Forgot Password links on the login portlet. I thought I could do these by changing the corresponding image files in my custom theme but that doesn't seem to work. Any help will be greatly appreciated:

Archivos adjuntos:

thumbnail
David H Nebinger, modificado hace 8 años.

RE: Change icons on Login portlet

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
They should be coming from the theme. Inspect the element and you'll see the URL that is being used, hopefully it will be from your theme.

Also remember the browser may have cached the image so it's serving an older one rather than a newer one.
thumbnail
William Gosse, modificado hace 8 años.

RE: Change icons on Login portlet

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
Yeah I tried clearing cache in my browser but no luck. Also it weird inspecting these images in firebug. I don't see the actual url for the mage itself. I see the following:
<img style="background-image: url('http://localhost:8080/MoasisAgency-theme/sprite/images/common/_sprite.png'); background-position: 50% -176px; background-repeat: no-repeat; height: 16px; width: 16px;" alt="" src="http://localhost:8080/MoasisAgency-theme/images/spacer.png" id="rjus_column1_0">

It looks like its being pull from a sprite.
thumbnail
David H Nebinger, modificado hace 8 años.

RE: Change icons on Login portlet

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
If you turn on dev properties you should get the actual image instead of the sprite reference.
thumbnail
William Gosse, modificado hace 8 años.

RE: Change icons on Login portlet (Respuesta)

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
I figure this out. If I create a custom hook for the sign in jsp and change the name of the image in the liferay-ui:icon tag it will find that file in my theme.

<c:if test="<%= showCreateAccountIcon %>">
<liferay-ui:icon
image="my_add_user"
message="New User"
url="<%= PortalUtil.getCreateAccountURL(request, themeDisplay) %>"
/>
</c:if>
thumbnail
Olaf Kock, modificado hace 8 años.

RE: Change icons on Login portlet

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
You could also have changed them in your theme. The sprite does get built from the images that you can find in the directory.

On the other hand: Both ways work. The theme is more elegant, but a JSP hook gets the work done as well.
thumbnail
William Gosse, modificado hace 8 años.

RE: Change icons on Login portlet

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
I tried changing the image files in the theme but they didn't seem to wind up in the sprite for some reason. I created an _diff/images/common folder where I put new images that had the same names as the originals. I saw that they were winding up in the images/common folder for deployment. Also I did this I tried clearing browser cache several times as well.

in the end I simply renamed those new image files in my theme's _diff/images/common folder to something new and then change the names in the hook and it started working.

No matter I needed the hook for other stuff anyway.