Combination View Flat View Tree View
Threads [ Previous | Next ]
lucas theisen
Theme Support
May 27, 2011 11:50 AM
Answer

lucas theisen

Rank: New Member

Posts: 18

Join Date: March 1, 2011

Recent Posts

I have been attempting to integrate Liferay Themes into my portlet that uses alloyfaces. My problem is that I want to re-use images from the current theme as background images in my portlet. More specifically, I would like to use the 05_right.png and 05_down.png while creating a twisty (or panelCollapsible in ICEfaces parlance). Basically I have this:

 1
 2<style>
 3.action-not-link {
 4    color: black;
 5    text-decoration: none;
 6}
 7
 8.twisty-closed {
 9    background-image: url([i]link to theme image 05_right.png[/i]);
10}
11
12.twisty-open {
13    background-image: url([i]link to theme image 05_right.png[/i]);
14}
15
16.twisty-closed,
17.twisty-open {
18    font-size: 13px;
19    font-weight: bold;
20    padding-left: 20px;
21}
22</style>
23...
24<h:panelGroup layout="block">
25  <h:commandLink actionListener="#{twisty.toggleExpanded}" immediate="true"
26    styleClass="action-not-link">
27    <h:outputText value="#{twisty.name}" styleClass='#{twisty.expanded ? "twisty-open" : "twisty-closed"}' />
28  </h:commandLink>
29</h:panelGroup>
30<h:panelGroup layout="block" rendered="#{twisty.expanded}">
31  [i]Some twistied content goes here[/i]
32</h:panelGroup>


Is there/could there be a servlet (or some other mechanism I am unaware of) that could proxy requests for something like url(liferay-theme/images/05_right.png) to the appropriate image in the current theme?
Neil Griffin
RE: Theme Support
May 9, 2012 9:32 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2216

Join Date: July 26, 2005

Recent Posts

@Lucas: I'm reviewing some old forum posts and I'm sorry that I missed getting back to you on this.

If you include liferay-faces-portal (formerly known as liferayfaces) then you should be able to use an EL-expression in a CSS resource like this:
1.my-icon {
2    background-image: #{liferay.themeImagesURL}/common/add.png;
3}


Please let me know if that works for you. Thanks.