2

I am rendering my node fields using:

<?php print render($content['field_website_link']); ?>

On the front end this is printing as:

<a class="upper" href="            http://www.domain.co.uk    " 
title="Link to our Website" target="_blank">Visit Website →</a>

For some reason it is adding the same whitespace around the rendered field. The field format is plain text and their is no whitespace in the actual field. This is the same for all text fields.

Any ideas?

Thanks Robert

3
  • I would suggest there might be something haywire in your theme or a field preprocess. Dont paste the results here but what do those field values look like if you do <pre><?php print_r($content);?></pre>?
    – Duncanmoo
    Commented Jul 17, 2012 at 19:50
  • The fields look fine when I do a print_r on them. They look how they should. There is no CSS on them either that would be adding it. For now I have used PHP trim but shouldn't need to use this.
    – Rob Fyffe
    Commented Jul 18, 2012 at 8:41
  • Something which tests if it is the theme messing with output is to switch to one of the default themes and then view those fields/pages.
    – Duncanmoo
    Commented Jul 18, 2012 at 13:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.