I have a FieldRenderer control on my web page which is bound to a Sitecore item.
fieldRenderer.Item = SomeSitecoreItem;
fieldRenderer.FieldName = "SomeField";
Now SomeField within my SomeSitecoreItem has NVelocity tokens. How can I have fieldRenderer to render those NVelocity tokens.
For example the content of SomeField could be the following markup:
<h1>$!SomeToken</h1>
Is there a way to render $!SomeToken to be replaced by the corresponding value from code behind?
You could add a step in the renderField pipeline:
The code could look like this:
NOTE: This pipeline is run for every field rendered so it is paramount that it is very fast - hence the ShouldRun method for breaking out early. Do not do anything expensive here unless you have to.