1

I have added three fields to user profile (field_firstname, field_lastname, field_user_gender) and I want to display them on user profile page. Default render($user_profile) displays values of those fields continuously, for instance: JohnMalkovichMale

How I can do this right? And how I can get names of fields?

  • try enclosing them in <pre></pre> tag. – AjitS May 4 '12 at 9:32
  • But what? render($ser_profile) ? I don't think so. – kobylecki May 4 '12 at 9:43
3

This is just a CSS issue. Use developer tools/firebug to determine the class/id of the element wrapping each field, and add a CSS rule such as the following to your theme:

.field-wrapper-1, .field-wrapper-2 { display: block; }
  • No, it's not. There is no HTML markup. Just string 'JohnMalkovichMale' – kobylecki May 4 '12 at 9:41
  • 1
    Then your theme is overriding the output that it usually added to fields. Copy the field.tpl.php file to your theme's folder (make sure you have the markup from the link above in it), clear Drupal's caches and you'll be good to go – Clive May 4 '12 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.