Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marcus Hain
Referring to images from templates
December 20, 2011 3:23 AM
Answer

Marcus Hain

Rank: New Member

Posts: 12

Join Date: November 15, 2011

Recent Posts

Hi.

How can I refer to images from my theme when I'am in webcontent template. I used ${themeDisplay.pathThemeImages}/my_image.jpg but it didn't work.

Best regards.
Mayur Patel
RE: Referring to images from templates
December 20, 2011 4:41 AM
Answer

Mayur Patel

Rank: Expert

Posts: 349

Join Date: November 17, 2010

Recent Posts

Marcus Hain:
Hi.

How can I refer to images from my theme when I'am in webcontent template. I used ${themeDisplay.pathThemeImages}/my_image.jpg but it didn't work.

Best regards.


Hi Marcus,

you can try this,

<img src="$request.theme-display.path-theme-images/thumbnail.png" />

Thanks,
Mayur
Marcus Hain
RE: Referring to images from templates
December 20, 2011 5:40 AM
Answer

Marcus Hain

Rank: New Member

Posts: 12

Join Date: November 15, 2011

Recent Posts

Hi Mayur,

It works perfectly, thanks a lot.

Marcus.
Mayur Patel
RE: Referring to images from templates
December 20, 2011 10:03 PM
Answer

Mayur Patel

Rank: Expert

Posts: 349

Join Date: November 17, 2010

Recent Posts

Good to hear that Marcus, you can mark as an answer if solved emoticon
Andrew Jardine
RE: Referring to images from templates
October 30, 2013 12:38 PM
Answer

Andrew Jardine

Community Moderator

Rank: Liferay Legend

Posts: 1062

Join Date: December 22, 2010

Recent Posts

I know this is an old post but in case anyone comes across it now looking for a solution I thought I would add this. An alternative to the solution given here is to use one of the tokens provided. In this case you can use @theme_image_path@ to refer to the themes images folder.