+ Start a Discussion
ArenoAreno 

Urgent!! Passing URL dynamically

Hi Everyone,

i have an issue. I have multiple URl's according to language like
www.google/en_CN
www.google/Zh_CN
www.google/en_MX
www.google/es_MX

each .com is like if Cn user views it in china they can view it in own chinese language if they click www.google/Zh_CN

and if Cn user wants to view website in englisg they will clcik www.google/en_CN 

I dont want to hard code the website link in my VF page like this

<apex:outputLink value="www.google/en_CN " target="_blank" rendered="{!if (language == 'zh_CN',true,false)}"> {!$Label.QW_Click} </apex:outputLink>

I need to pass all the URl dynamically in to the controller so that I can use it here. How do I do that?
Rohit Sharma 66Rohit Sharma 66
Try using a hierarchial custom setting that is a Org level configuration and create field that store URL for each language.
 
Now use below code to fethc the URL in VF page.
You can fetch it like {!$Setup.Your_ConfigurationSettingName__c.Field_Name__c} 
 
See this for more : http://blog.jeffdouglas.com/2010/02/08/using-hierarchy-custom-settings-in-salesforce-com/

Let me know if this works for you.
ArenoAreno
Hi rohit,

Thank for your response,

But I have already written a custom controller extension to get country code and language code for tha page. How do I populate the URL in my custom controller ?/

Thanks
Rohit Sharma 66Rohit Sharma 66
Just create a custom setting as shown in following blog:
See this for more : http://blog.jeffdouglas.com/2010/02/08/using-hierarchy-custom-settings-in-salesforce-com/

Then u can directly use that in the VF page system.label.FieldName