Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Passing Vanilla variables through PageManager extension?
Is there any way I could call a user's nickname through a custom PageManager page? I feel like there is a simple PHP echo I could do but I'm missing it.
0
This discussion has been closed.
Comments
if ($Context->Session->UserID > 0) { if (!@$UserManager) $UserManager = $Context->ObjectFactory->NewContextObject($Context, "UserManager"); $AccountUserID = ForceIncomingInt("u", $Context->Session->UserID); if (!@$AccountUser) { $AccountUser = $UserManager->GetUserById($AccountUserID); $DispFName = $AccountUser->FirstName; $DispLName = $AccountUser->LastName; $DispName = $AccountUser->Name." ".$DispFName . " " . $DispLName; } } else { $DispName = " "; }
Hi, <?php echo $DispName ?>
Render: Hi, User
Because I am not seeing such. Is there any includes that need to occur before your body of code?
<?php echo $GLOBALS['Context']->Session->User->Name; ?>