We've got an articles section on our site where we have contributing users who submit these articles. In the links install for those articles, for the article itself there is an author field where we enter the user's username.
Meanwhile in the user's table we have added a field called 'bio'.
We'd like to be able to pull through the user bio of the author from the users table to display on the articles page. And do so in the least convoluted way.
Would we need to create a global for this? Or is there an easier way?
I've tried creating a gobal, but my Perl is beyond awful.
my $LinkOwner = shift;
my $db = $DB->table('Users');
return $db->table('Users')->select(['Bio'], { Username => $LinkOwner })->fetchrow_array;
}
Meanwhile in the user's table we have added a field called 'bio'.
We'd like to be able to pull through the user bio of the author from the users table to display on the articles page. And do so in the least convoluted way.
Would we need to create a global for this? Or is there an easier way?
I've tried creating a gobal, but my Perl is beyond awful.
Code:
sub { my $LinkOwner = shift;
my $db = $DB->table('Users');
return $db->table('Users')->select(['Bio'], { Username => $LinkOwner })->fetchrow_array;
}