1

I have a custom token %tokenname% in single line text and richtext fields. I would like to replace the token with some custom value in the Sitecore JSON rendering. Please see some example data below:

{
  "uid": "04f1b740-1eff-415e-a1c3-93bce2c2a274",
  "componentName": "GeneralContent",
  "dataSource": "{0F766E67-7341-4155-B53F-5BEA598C8C24}",  
  "fields": {
    "Subheading": {
      "value": "" 
    },
    "Body": {
      "value": "This is the %tokenname% I would like to buy"
    },
    "Heading": {
      "value": "Limited to number of %tokenname% to buy."
    }
  }
}

Just wondering where can I do that. I tried with Sitecore.Pipelines.RenderField pipeline which doesn't work. Is that because I can't use it for JSON Rendering which is different from the traditional Sitecore MVC Controller Rendering?

1
  • Can we have some front end code where you are consuming the field? You should be able to manipulate the value before displaying it. Jun 27 at 13:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.