I have a content type called Match Report, and have enabled the 6.x-1.1 version of Contemplate module.

This Content Type displays normally, until I tick the "Affect body output" check box and save the changes. I have made no changes to the Body Template.

The error message displayed is:
Parse error: syntax error, unexpected '&' in mysite.com/sites/all/modules/contemplate/contemplate.module(834) : eval()'d code on line 4

The body template which is created automatically is:

<div class="field field-type-date field-field-fixture-date">
<h3 class="field-label">Date</h3>
<div class="field-items">
<div class="field-item"><?php print $node-&gt;field_fixture_date[0]['view'] ?></div>
</div>
</div>
<div class="field field-type-nodereference field-field-opponents">
<h3 class="field-label">Opponents</h3>
<div class="field-items">
<div class="field-item">&lt;?php print $node-&gt;field_opponents[0]['view'] ?&gt;</div>
</div>
</div>
<div class="field field-type-text field-field-home-away">
<h3 class="field-label">Played at</h3>
<div class="field-items">
<div class="field-item">&lt;?php print $node-&gt;field_home_away[0]['view'] ?&gt;</div>
</div>
</div>
<div class="field field-type-text field-field-result">
<h3 class="field-label">Result</h3>
<div class="field-items">
<div class="field-item">&lt;?php print $node-&gt;field_result[0]['view'] ?&gt;</div>
</div>
</div>
<div class="field field-type-text field-field-match-report">
<h3 class="field-label">Match Report</h3>
<div class="field-items">
<div class="field-item">&lt;?php print $node-&gt;field_match_report[0]['view'] ?&gt;</div>
</div>
</div>
<div class="field field-type-number-integer field-field-scored-by-wells">
<h3 class="field-label">Wells Scored</h3>
<div class="field-items">
<div class="field-item">&lt;?php print $node-&gt;field_scored_by_wells[0]['view'] ?&gt;</div>
</div>
</div>
<div class="field field-type-number-integer field-field-scored-by-opponents">
<h3 class="field-label">Opponents Scored</h3>
<div class="field-items">
<div class="field-item">&lt;?php print $node-&gt;field_scored_by_opponents[0]['view'] ?&gt;</div>
</div>
</div>

Let me know what else you need to debug this. Thanks

Comments

jrglasgow’s picture

hmmm.....
on line 4, this line:

<div class="field-item"><?php print $node-&gt;field_fixture_date[0]['view'] ?></div>

should be

<div class="field-item"><?php print $node->field_fixture_date[0]['view'] ?></div>
maxweld’s picture

Thanks
I changed the &gt; on line 4 and on all other lines and this solves the parsing error, although I am not sure why the generated code should contain the &gt; instead of the ">".

The page now displays, but instead of the values expected it shows the php code:

for example, for line 4
<?php print $node->field_fixture_date[0]['view'] ?>
although this is formatted

maxweld’s picture

After a bit of fiddling I noticed that there was a &lt; on similar lines, but not on line 4.
I have corrected this and the fields now display as expected.

So I think it now only remains to understand how the &lt; and &gt; got there in the first place.

maxweld’s picture

Status: Active » Closed (fixed)

I believe that the error was caused by my use of the FCKeditor. Its use with this field seems to introduce the conversion from < or > to &lt; or &gt;
I think you we can close the issue.
Thanks for your help