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
Praz01Praz01 

using static resource as properties file

I want to diplay some text in the page which I don't want to hardcode or type in the page rather using some properties file for this. Can I used static resource file for this. If yes how can I? I did not get any reference from the pdfs.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

You create custom labels through configuration - Setup -> App Setup -> Create -> Custom Labels.

 

Then you can access them in your visualforce code like so:

 

 

{!$Label.MyLabel}

 

where MyLabel is the name that you gave the label when creating it.

 

All Answers

bob_buzzardbob_buzzard

Have you considered custom labels?  That is an easier way to add configurable text to your pages than uploading resource files.  Its also easier for someone else to change.

Praz01Praz01
Bob, Can you give me an example please
bob_buzzardbob_buzzard

You create custom labels through configuration - Setup -> App Setup -> Create -> Custom Labels.

 

Then you can access them in your visualforce code like so:

 

 

{!$Label.MyLabel}

 

where MyLabel is the name that you gave the label when creating it.

 

This was selected as the best answer
Praz01Praz01

Thanks a lot :smileyhappy:

Praz01Praz01

One problem is I cannot store any hypertext here in the label....

NareshKrishnaNareshKrishna

Hi Bob/Praz,

 

How can we get label value based on label name from properties file (static resource) instead of creating custom labels ?

Because creating custom labels for all properties is time consuming process.

 

Could you please help me with this.

 

Thanks.