The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding thumbnail pictures to portlets

Highlighted
Jaylen Smith
Regular Collector

Adding thumbnail pictures to portlets

I would like to add a jpg picture that will appear as a thumbnail picture in a request list portlet. Therefore, in the request list portlet, each request would have its own imported thumbnail picture associated with it. Does anyone know if this is possible?
4 REPLIES
Erik Cole
Honored Contributor

Re: Adding thumbnail pictures to portlets

Sure, here's how...assuming you're creating a custom portlet:

In your data source, choose column type Text and get it to return a URL where the image can be found. You can test with some static SQL field, like

'http://:8080/itg/html/Mercury-icon-small.gif'

In your portlet definition, chose Icon for this field.

Obviously, if you're using a limited set of images you can place them in that html directory and have your SQL pick up the correct one. If they vary greatly and you are saving the images on the requests themselves, it will require some more work but the technical ability is there.

You can even use URLs from another web server, like this sunny day picture:

'http://image.weather.com/web/common/wxicons/52/32.gif?12122006'
Jaylen Smith
Regular Collector

Re: Adding thumbnail pictures to portlets

thank you!
Mike Ramberg
Super Collector

Re: Adding thumbnail pictures to portlets

Eric, great reply here, your solution works exactly as described. I wonder if there is a way to use the token [AS.BASE_URL] so that the server name does not have to be re-typed when you migrate the data source to another server. I tried to get this, but because the SQL line is set as Text, it will not resolve the token. Any thoughts?
Erik Cole
Honored Contributor

Re: Adding thumbnail pictures to portlets

Hi Mike,

I don't think you can parse a token there, but you can use a relative URL and make it "go back" to your base URL.

So the relative URL for

'http:///itg/html/Mercury-icon-small.gif'

would look something like

'../../../../itg/html/Mercury-icon-small.gif'
//Add this to "OnDomLoad" event