Resource strings Kentico 7

Chetan Sharma asked on April 29, 2015 14:06

Hello All,

What is the best way to keep and access a resource string like "Hello World" on Kentico and how to access it.

I know Kentico has Content Block in version but we still are not going soon on Kentico 8.

Localization is not a concern for me. I would like to keep them in a way so that there is a way via K# to access it directly anywhere.

Please suggest.


Recent Answers

Brenden Kehren answered on April 29, 2015 14:43

Use the UI Localization module. This way you can access the strings in C# and K#. Here are a few things to note:

  • By default, Kentico uses the database first to retrieve resources, then any custom.resx file, then cms.resx
  • Kentico has a cms.resx file in the /CMSResources directory, which can be modified, but not recommended
  • If you enter a record using Site Manager>Development>UI Cultures with the same key as what is in the cms.resx file, the database value will override the .resx file
  • If you enter <add key="CMSUseSQLResourceManagerAsPrimary" value="false" /> in your web.config, SQL will be last in the order of retrieving your resources.

Short answer is I'd recommend using the database as it offers the most flexibility, access and easy to upgrade.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.