Rendering Resources
You can render resource through a Resource Control.
<CSControl:ResourceControl
runat="server"
ResourceName="resourceName" />
The Resource Control will display the resourceName resource from resources.xml. If you want to use a different resource file, specify the Resource File to use on the Control.
<CSControl:ResourceControl
runat="server"
ResourceName="resourceName" />
You can also specify Parameterised resources. Most Chameleon Single Value controls allow you to use {0} in the resource to use the control would normally display. For example, if you specified the following resource in a custom resource file (e.g. "MyResourceFile.xml")
<resource name="postedDetails">Welcome Back {0}!</resource>
you could then use the following markup to display Welcome Back USERNAME:
<CSControl:UserData runat="server"
Property="DisplayName"
ResourceName="UserName"
ResourceFile="MyResourceFile.xml" />
You can display multiple parameters in the same resource. For example, to display Posted on DATE by USERNAME in the forums (where DATA and USERNAME are the date a post was made and the user name of the user who made the post respectively), you can specify the following in a resource file:
<resource name="postedDetails">Posted on {0} by {1}</resource>
Then in your theme you can use the following markup:
<CSControl:ResourceControl
runat="server"
ResourceName="postedDetails"
ResourceFile="MyResourceFile.xml" >
<Parameter1Template>
<CSForum:ForumPostData runat="server"
Property="PostDate" />
</Parameter1Template>
<Parameter2Template>
<CSControl:UserData runat="server"
Property="UserName" />
</Parameter2Template>
</CSControl:ResourceControl>
This markup replaces {0} in the resource with the Parameter1Template, {1} with the Parameter2Template. The ResourceControl supports specifying up to 9 different parameter templates, but more could be used by programmatically using resources.
Programmatically using resources
You can programmatically access resources by using the CommunityServer.Components.ResourceManager.GetString methods.
To get a resource from the default resource file (resources.xml), use
ResourceManager.GetString("resourceName");
To get a resource from a custom resource file, use
ResourceManager.GetString("ResourceName", "ResourceFileName.xml");