Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I was wondering if anyone knows if it is possible to add the content profile field (ie first name) to the $user object so that it can be printed anywhere such as on page.tpl.php
I would appreciate the support!
Thank you
Comments
Comment #1
jeffschulerYou can use theme preprocess functions to make data accessible to your theme templates.
A couple good starting places are:
Comment #2
mttjn CreditAttribution: mttjn commentedi would like to know how to add content profile fields to $user object too...
anyone?
@jeffschuler: can you explain, please?
Thanks in advance!
Comment #3
Lehtóri CreditAttribution: Lehtóri commentedsomething like this should work:
Comment #4
KingMoore CreditAttribution: KingMoore commentedTry this: