13

I think we've stumbled into an edge-case issue with the JSON producing DD4T TBB(s), so I am looking for some input / confirmation.

We have a Schema, which has a simple text-field and a multivalued embedded Schema. The embedded Schema is a standard "link" Schema - with an internal Component link, an external text field - etc.

Component

enter image description here

Problem

The problem we've run into is that if we include the string ComponentTemplate in a text-field, the Component Presentation is not included in the list of Component Presentations in the Page JSON. The string is not case-sensitive, so componenttemplate also excludes the Component Presentation from the rendered output.

When we run the Component Template against the Component in Template Builder, there is output which looks valid. There seems to be no issues there. The issue only seems to be adding the Component Presentation to the Page JSON.

Note that the Component Template is static.

What we've tried

  • We've tried removing special characters (ampersands etc), which has no effect.
  • We've also tried moving the string around - but again, no change.
  • Tried the string in both embedded fields, & direct content fields. Same result.

The following URLs exclude the Component Presentation from output:

The following URLs work fine:

I'm not quite sure what would cause this issue. It's a bit of a strange one that we just happened to notice by chance. We assumed it was the ampersand, but that doesn't seem to be the issue.

Any input is appreciated!

  • Josh, are there any errors/warning/info in the dd4t log? Try setting the log level to TRACE and see if something useful shows up in there. From the looks of it, I think it has to do something with JSON parsing and if there's bad JSON in there then I would expect the log files to indicate the same. – Kunal Jun 21 '16 at 11:57
  • Hey Kunal. I've checked the logs & didn't see anything useful. I didn't see any errors or warnings indicating that the JSON parsing failed, even though I suspect you're right :) – Josh Hebb Jun 23 '16 at 19:08
  • Hi Josh, could you provide the generated JSON please? – Phil Medcraft May 15 '17 at 20:19
  • Hi Josh, could you post the generated sample JSON? – Velmurugan Jun 3 '17 at 6:32
  • Sorry for the delay guys @PhilMedcraft - here's the sample JSON pastebin.com/YNVHi7c5. The CP is on the page, but is left out of the JSON. If I remove that string from content, the CP comes back in the JSON. – Josh Hebb Jun 8 '17 at 18:19

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.