Drupal print breaks when rendering a region

62 views Asked by At

I've come across a bit of a stumbling block with the

<?php print render ($page['pages_machine_name']); ?>

code in a Drupal site. The issue only started when moving from 7.33 to 7.36.

What happens is, rather than display the content of the page, which in this instance is a <ul>, it puts several wrapping <div>s and <span>s round the <ul> and it's content. This is fine, but what happens is, they render out with incomplete links and as such, break the rest of the page:

<a href="http://www.domain.co.uk&lt;div class=" field="" field-name-field-link-three-url="" field-type-text="" field-label-above"="">"&gt;
<div class="field field-name-field-link-three-name field-type-text field-label-above"><div class="field-label">Link Three | Name:&nbsp;</div><div class="field-items"><div class="field-item even">Our people</div></div></div></a>

As you can see, the end of the website's domain is marked up with a less than rather than an actual symbol and as such, breaks all the other tags that follow it.

Does anyone know what could be causing this and what can be done to fix it?

Thanks in advance for any help you can provide :)

1

There are 1 answers

0
tamegeek On BEST ANSWER

When searching I found this page link on which, the code offers the following solution: (Edited from 'filename' to 'value' to get get the text value inside the field) <?php print $node->field_name_goes_here['und']['0']['value']; ?> This delivers exactly what I was looking for, in this case, just the content of the field. Hope this can help other in the future.