This could be accomplished by embedding PHP code in the article and getting the user information within the PHP code.
Extensions such as Sourcerer (https://extensions.joomla.org/extension/sourcerer/) could be used for this purpose.
One of the advantages of Sourcerer is that it already creates the following variables ready for use (https://docs3.regularlabs.com/sourcerer ... g-php-code):
$app The Joomla application framework
$document or $doc The html document
$database or $db The database
$user The user object containing the details of the guest or current logged in user
$Itemid The menu id of the page
$article The article object (only available when using the code inside articles)
I installed Sourcerer and created the following content:Following is the result of this. Notice the logged in user name John Doe showing:
Extensions such as Sourcerer (https://extensions.joomla.org/extension/sourcerer/) could be used for this purpose.
One of the advantages of Sourcerer is that it already creates the following variables ready for use (https://docs3.regularlabs.com/sourcerer ... g-php-code):
$app The Joomla application framework
$document or $doc The html document
$database or $db The database
$user The user object containing the details of the guest or current logged in user
$Itemid The menu id of the page
$article The article object (only available when using the code inside articles)
I installed Sourcerer and created the following content:
Code:
<p>Hello {source}<?php echo $user->name.',';?>{/source}</p><p>Welcome to the test site.</p>
Statistics: Posted by imanickam — Wed Aug 07, 2024 7:47 am