Guest User

Untitled

a guest
Apr 2nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.66 KB | None | 0 0
  1. @* MAIN SCHEMA FIELDS *@
  2. "type":"@Fields.type",
  3. "headline":"@Fields.headline",
  4. "asset":
  5. {
  6. @* SINGLE VALUE EMBEDDED ASSET SCHEMA FIELD *@
  7. "media":"@Fields.asset.media.ID",
  8. "credit":"@Fields.asset.credit",
  9. "caption":"@Fields.asset.caption"
  10. },
  11. "text":"@HtmlEncode(Fields.text)",
  12. "startDate":"@Fields.startdate.ToString("dd/mm/yy")",
  13. "date": [
  14. {
  15.  
  16. @* LOOP TRUE THE EMBEDDED DATE SCHEMA FIELD *@
  17. @if (Fields.date.Count > 0) {
  18. @foreach (var embeddedField in Fields.date) {
  19.  
  20. ff @embeddedField.startdate.ToString("dd/mm/yy")
  21.  
  22. }
  23. }
  24.  
  25. }
  26. ]
  27.  
  28.  
  29. }
  30.  
  31. TemplateCompileException: CS1002: ; expected
  32. Line 79 Column 24: if (Fields.date.Count > 0) { foreach (var embeddedField in Fields.date) { * ff @embeddedField.startdate.ToString("dd/mm/yy") } }WriteLiteral("ttttnttt}ntt]nnnt}n}");
  33.  
  34. CS1525: Invalid expression term '.'
  35. Line 79 Column 24: if (Fields.date.Count > 0) { foreach (var embeddedField in Fields.date) { * ff @embeddedField.startdate.ToString("dd/mm/yy") } }WriteLiteral("ttttnttt}ntt]nnnt}n}");
  36.  
  37. CS1002: ; expected
  38. Line 79 Column 25: if (Fields.date.Count > 0) { foreach (var embeddedField in Fields.date) { * ff @embeddedField.startdate.ToString("dd/mm/yy") } }WriteLiteral("ttttnttt}ntt]nnnt}n}");
  39.  
  40. CS1002: ; expected
  41. Line 79 Column 55: if (Fields.date.Count > 0) { foreach (var embeddedField in Fields.date) { * ff @embeddedField.startdate.ToString("dd/mm/yy") } }WriteLiteral("ttttnttt}ntt]nnnt}n}");
  42.  
  43. Stack Trace:
  44. at Tridion.Extensions.Mediators.Razor.Templating.Compiler.Compile(IEnumerable`1 entries, IEnumerable`1 assemblyReferences)
  45. at Tridion.Extensions.Mediators.Razor.Templating.RazorTemplateGenerator.CompileTemplates(IEnumerable`1 assemblyReferences)
  46. at Tridion.Extensions.Mediators.Razor.RazorHandler.Compile(DateTime revisionDate)Unable to save Template Building Block (tcm:39-270613-2048).
  47.  
  48. {
  49. "timeline:"
  50. {
  51.  
  52. @* MAIN SCHEMA FIELDS *@
  53. "type":"@Fields.type",
  54. "headline":"@Fields.headline",
  55. "asset":
  56. {
  57. @* SINGLE VALUE EMBEDDED ASSET SCHEMA FIELD *@
  58. "media":"@Fields.asset.media.ID",
  59. "credit":"@Fields.asset.credit",
  60. "caption":"@Fields.asset.caption"
  61. },
  62. "text":"@HtmlEncode(Fields.text)",
  63. "startDate":"@Fields.startdate.ToString("dd/mm/yy")",
  64. "date": [
  65. {
  66.  
  67. @* LOOP TRUE THE EMBEDDED DATE SCHEMA FIELD *@
  68. @if (Fields.date.Count > 0) {
  69. @foreach (var embeddedField in Fields.date) {
  70.  
  71. @embeddedField.startdate.ToString("dd/mm/yy")
  72.  
  73. }
  74. }
  75.  
  76. }
  77. ]
  78.  
  79.  
  80. }
  81. }
  82.  
  83. {
  84. "timeline:"
  85. {
  86. @* MAIN SCHEMA FIELDS *@
  87. "type":"@Fields.type",
  88. "headline":"@Fields.headline",
  89. "asset":
  90. {
  91. @* SINGLE VALUE EMBEDDED ASSET SCHEMA FIELD *@
  92. "media":"@Fields.asset.media.ID",
  93. "credit":"@Fields.asset.credit",
  94. "caption":"@Fields.asset.caption",
  95. },
  96. "text":"@HtmlEncode(Fields.text)",
  97. "startDate":"@Fields.startdate.ToString("dd/mm/yy")",
  98. "date": [
  99. {
  100. @* LOOP TRUE THE EMBEDDED DATE SCHEMA FIELD *@
  101. @if (Fields.date.Count > 0) {
  102. @foreach (var embeddedField in Fields.date) {
  103. <text>"startDate":"</text>@embeddedField.startdate.ToString("dd/mm/yy")<text>",</text>
  104. <text>"headline":"</text>@HtmlEncode(embeddedField.headline)<text>",</text>
  105. <text>"text":"</text>@HtmlEncode(embeddedField.text)<text>"</text>
  106.  
  107. <text>"asset":</text>
  108. <text>"media":"</text>@embeddedField.asset.media.ID<text>",</text>
  109. <text>"credit":"</text>@embeddedField.asset.credit<text>",</text>
  110. <text>"caption":"</text>@embeddedField.asset.caption<text>",</text>
  111. <text>}</text>
  112. }
  113. }
  114. }
  115. ]
  116. }
  117. }
  118.  
  119. {
  120. "timeline:"
  121. {
  122.  
  123. "type":"default",
  124. "headline":"Sh*t People Say",
  125. "asset":
  126. {
  127.  
  128. "media":"tcm:39-270610",
  129. "credit":"",
  130. "caption":"Writers & Creators: Kyle Humphrey & Graydon Sheppard",
  131. },
  132. "text":"When &amp;quot;Shit Girls Say&amp;quot; was uploaded to YouTube it was picked up by Reddit, the Huffington Post, Mashable etc. In a month, it racked up over 12 million views and has spawned a meme of Sh*t People Say.",
  133. "startDate":"25-52-13",
  134. "date": [
  135. {
  136.  
  137. "startDate":"19-23-13",
  138. "headline":"Sh*t Politicians Say",
  139. "text":"Sh*t Politicians Say landed just hours before Thursday night’s Republican presidential debate and stars actor Joe Leon. In true political fashion, his character rattles off common jargon heard from people running for office.&lt;/p&gt;&lt;p&gt;Do these ring a bell? Moral fiber, family values, trust me, three-point plan, earmarks, tough question, children are our future, Washington outsider, jobs, my opponent — all sound familiar."
  140. "asset":
  141. "media":"tcm:39-270610",
  142. "credit":"sd",
  143. "caption":"sd",
  144. }
  145. }
  146. ]
  147. }
  148. }
Add Comment
Please, Sign In to add comment