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
BinayakBinayak 

Accessing domain name from sites page

How to access the domain name of the salesforce org from the sites page(i.e. if org is https://cs7.salesforce.com,then accessing it from sites page). System.URL.getSalesforceBaseUrl().getHost() didnot provide the proper result.Still we can substring it to get the results.But from sites page,it fails.Donot want to store it in a label and then access it from the controller of the site page.Any idea for retrieving the value dynamically....

bob_buzzardbob_buzzard

Check out the $Site global variable:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_variables_global.htm

 

This has methods that allow access to the URL, domain etc.

 

You can use these on a page.