Page 1 of 1
Add bio of users/authors?
Posted: Wed Jun 12, 2019 6:09 am
by Renaud
Hello,
How can I add a little bio for each user? :

It it diffucult to code? I can try to do it muself if you just tell me where is the code.
It's to add here :
Thanks
Re: Add bio of users/authors?
Posted: Wed Jun 12, 2019 4:28 pm
by Jay
Check this thread on githbub:
https://github.com/bludit/bludit/issues/963
tldr; use firstName field for a short description, and then just show field's content in theme using below snippet:
Code: Select all
<?php echo $page->user('firstName'); ?>
I don't remember if you can format text in this field using html tags, but I'd give a shot.
Re: Add bio of users/authors?
Posted: Wed Jun 12, 2019 7:31 pm
by Renaud
Jay wrote: Wed Jun 12, 2019 4:28 pm
tldr; use firstName field for a short description, and then just show field's content in theme using below snippet:
Code: Select all
<?php echo $page->user('firstName'); ?>
Nice workaround, I like it! I will try to find a nice design with it.
Re: Add bio of users/authors?
Posted: Wed Mar 18, 2026 8:38 pm
by Misteric
To add a bio for the users:
bl-kernel -> user.class.php
public function profilePicture() { ... }
Code: Select all
public function bio()
{
return $this->getValue('bio');
}
public function json($returnsArray = false) { ... }
bl-kernel -> users.class.php
Code: Select all
protected $dbFields = array(
'firstName'=>'',
'lastName'=>'',
...
...
...
'bio' =>''
);
bl-kernel -> admin -> views -> edit-user.php
Code: Select all
<!-- TABS -->
<nav class="mb-3">
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="nav-profile" aria-selected="false"><?php $L->p('Profile') ?></a>
<a class="nav-item nav-link" id="nav-picture-tab" data-toggle="tab" href="#picture" role="tab" aria-controls="nav-picture" aria-selected="false"><?php $L->p('Profile picture') ?></a>
...
...
...
<a class="nav-item nav-link" id="nav-social-tab" data-toggle="tab" href="#bio" role="tab" aria-controls="nav-bio" aria-selected="false"><?php echo "Bio" ?></a>
</div>
</nav>
bl-kernel -> admin -> views -> edit-user.php
after the <!-- Social Networks tab --> ...
Code: Select all
<!-- Social Bio tab -->
<div class="tab-pane fade" id="bio" role="tabpanel" aria-labelledby="nav-bio-tab">
<?php
echo Bootstrap::formTextarea(array(
'name' => 'bio',
'label' => 'Bio',
'value' => $user->bio(),
'class' => '',
'placeholder' => 'Fill in some information about you',
'tip' => '',
'rows' => 10
));
?>
</div>
Echo the user bio:
Code: Select all
$allUsers = $users->keys();
foreach ($allUsers as $username) {
$user = new User($username);
if ($user->enabled()) {
echo '<p>'. $user->bio() . '</p>';
}
}
echo '</div>';
In the (bl-kernel -> admin -> views -> edit-user.php) bio-tab it just echo 'Bio'. :
The languages must first be updated.
Misteric