Displaying a User's Signature on a Node Page in Drupal
⚠️ Warning
This post is more than 10 years old. I do not delete posts, because even old information is still useful, but please know that some material on this page may be outdated or incorrect. Thanks!
This post is more than 10 years old. I do not delete posts, because even old information is still useful, but please know that some material on this page may be outdated or incorrect. Thanks!
A project I'm working on required a user's signature be displayed on the user's blog posts (only on the page—not in blog teaser listings), and after much wrangling, I figured out how to put the 'Biography' (one of the user profile fields) into the nodes when they were viewed individually.
Here's the snippet (to be placed into node.tpl.php or node-blog.tpl.php):
<code>
<?php if (!$teaser): ?>
<?php $account = user_load(array('uid' => $node->uid)); if (!empty($account->profile_bio)) { ?>
<div class="blogger-bio"><code>
profile_bio); ?>
Comments