1

Quick question : how can i get the "normal" base url from a community context ?

More details

It tryed to find an existing solution but keywords are returning everything but what i am looking for :)

Here is my problem: We are using pictures for external usage (email templates generated with visual force page). To display it in an external context, we are using this url

https://eu9.salesforce.com/servlet/servlet.ImageServer?id=##document_id##&oid=##organisation_id##

In VF page i am using

{!baseURL}/servlet/servlet.ImageServer?id={!loggedinUserImg}&oid={!$Organization.Id}

Where {!baseURL} = URL.getSalesforceBaseUrl().toExternalForm()

And {!loggedinUserImg} is a Document record id found with the current user name.

It was working fine with our "normal user", we just need to register a document with picture, external usage == true and some mapping system (we use user name as the name of the document).

But now we included a bunch of community users and it doesn't work anymore. The reason is {!baseURL} returning the custom community url that can be attached (i guess) to the servlet/servlet.ImageServer ... thing

Is there a solution to this problem ? Accessing "normal" base url or another solution allowing us to access our documents/pictures ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.