Reputation: 11
I am stuck somewhere as i could not find any solutions like i have a query can we change the logo for each user in joomla back-end ?
Or Any other CMS, can you suggest which contains this type of facility.I Need to show the different 2 logo for each other who has been registered on my website (administrator would do that)
Any Suggestion would be very thankful.
Thanks a lot !!
Upvotes: 1
Views: 136
Reputation: 400
If you want a specific logo for each user, i.e. unique to each user, you can use a combination of CSS/PHP and save the images to a certain folder.
<style type="text/css">
<?php
$user =& JFactory::getUser();
?>
/* This needs to reference the element you are changing */
#logo{
background: url(/blah/images/<?php echo $user->id; ?>-logo.png);
}
</style>
Or you can simply swap the reference to the img if it is using an image rather than a background image.
<img src="/blah/<?php echo $user->id; ?>-logo.png"/>
I wasn't sure what version of Joomla, or which logo you were replacing so I could not be more specific. You could even take it one step further and check that the image/file exists first using
if(file_exists('path-to-blah/<?php echo $user->id; ?>-logo.png'))
...
Upvotes: 1