function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HayaHaya 

Customer portal need sandbox to display images

Hello to all and Happy New Year,

My customer portal is not independent of the sandbox.
I have a customized url that takes me to the portal.
If the sandbox is not active in the browser most of my images are broken, when i logon to the sandbox the images are displayed correctly.
This is happening on IE, FF and Chrome.

Can someone help me out?

Regards,
Haya
Best Answer chosen by Haya
Sonam_SFDCSonam_SFDC
Happy New Year Haya!

is it a Sandbox Customer Portal?

Could you please check the URL of the images which appear broken using firebug or any browser component inspector to see from where these images are loading? try loading them using direct URL..

All Answers

Sonam_SFDCSonam_SFDC
Happy New Year Haya!

is it a Sandbox Customer Portal?

Could you please check the URL of the images which appear broken using firebug or any browser component inspector to see from where these images are loading? try loading them using direct URL..

This was selected as the best answer
CyberJusCyberJus
Did you develop the customer portal in the sandbox and then migrate it to production? It sounds like there are some hard links there to your sandbox instance. That is generally a pretty bad thing as you have just discovered. I would copy those images to production and then update your code to point to the new images. 

Are you using resources or documents to host these images?
HayaHaya
I am not in production yet, i am still working in the sandbox.
I am trying to understand the connection/differences between the images in Documents and images in Static Resources.

In documents i have a file named portal logo.
When I View file I see the html: https://cs3.salesforce.com/resource/1366877534000/portal_logo

This is what I loaded into the Portal Header
<div style="position:relative; width:720px; height:50px; margin: 0 auto;  padding:0px; left:0px;right:0px;z-index:1;"><img src="https://cs3.salesforce.com/resource/1366877534000/portal_logo" style="width:720px;height:50px;" /></div>

When i open the header image from a portal's page in a new tab the url is: https://cs3.salesforce.com/resource/1366877534000/portal_logo

How do i change the html to use a direct url?
Should I have loaded the image into Static Resources and used it from there?



 
HayaHaya
We need to migrate to production soon so I need to resolve this issue before that.
Can someone please help me with this?
Should I have my images in documents or in static resources?
How do I use a direct URL?
Help would be greatly appreciated.
Haya
HayaHaya
I think i found what my problem is but i do not know how to solve it.

This is my latest Portal Header:
<div style="width:100%;background-color: #1e1e1e; padding:20px 0;">
<div style="position:relative; width:720px; height:50px; margin: 0 auto;  padding:0px; left:0px;right:0px;z-index:1;"><img src="{!$Resource.portal_logo}" style="width:720px;height:50px;" /></div>
<div style="z-index:2; position:relative; margin: 0 auto; padding:0px;">
</div>
</div>

I have the portal_logo in Static Resources. When I view it the url is: https://cs3.salesforce.com/resource/1389858751000/portal_logo

But when i logon to the portal, the image is broken and when i open the broken image in a new tab the url is : https://cs3.salesforce.com/resource/1366877534000/portal_logo

I tried clearing cache but it doesn't help.
Is there a cache in the sandbox i need to clear?

 

 

 

HayaHaya
I think I am ok now.
This works:
<div style="width:100%;background-color: #1e1e1e; padding:20px 0;">
<div style="position:relative; width:720px; height:50px; margin: 0 auto;  padding:0px; left:0px;right:0px;z-index:1;"><img src="/forte/resource/portal_logo" style="width:720px;height:50px;" /></div>
<div style="z-index:2; position:relative; margin: 0 auto; padding:0px;">
</div>
</div>

I guess one cannot use apex code in the middle of html: <img src="{!$Resource.portal_logo}">

Thanks for pointing me in the right direction.
Haya