Added code to cassiopeia index.php to display welcome message if anyone other than guest is logged in:
<?php if ($user->guest !=1) : ?>
<div class="container-fluid">
<p class="floatleft">
<?php echo 'Welcome, ' . $user->name; ?>
</p>
</div>
<?php endif; ?>
No message when viewing website as casual viewer
Welcome,
J4.0 Alpha 7 nightly build from a few days ago on CloudAccess.net Joomla site.
Original code which works correctly on Joomla! 3.9.1 site which has the same error in J.4.0 as the code above:
<?php if ($user->guest !=1) { ?>
<div class="container-fluid">
<p class="floatleft">
<?php echo 'Welcome, ' . $user->name; ?>
</p>
</div>
<?php } ?>
Labels |
Added:
?
|
The code posted above, btw, does not exist in 3.9.x core.
The code we use in core is in the module and will display only when a user has logged in:
<?php if ($params->get('greeting', 1)) : ?>
<div class="login-greeting">
<?php if (!$params->get('name', 0)) : ?>
<?php echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('name'), ENT_COMPAT, 'UTF-8')); ?>
<?php else : ?>
<?php echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('username'), ENT_COMPAT, 'UTF-8')); ?>
<?php endif; ?>
</div>
<?php endif; ?>
For reference where the code from JMS is:
joomla-cms/modules/mod_login/tmpl/default_logout.php
Lines 19 to 27 in 56affaf
I'm closing this issue as it's not about core. If you need assistance to adjust your own template, feel free to ask in the forums.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-01-04 11:15:30 |
Closed_By | ⇒ | Bakual |
Thank you both @infograf768 and @Bakual
Where exactly do you want that code change? In the login module?
Imho, that one already has an option to enable such a greeting which only applies when someone is logged in.