Topic-icon How do I use images for login and logout instead of buttons?

Active Subscriptions:

None
I am planning create two modules one for guests and one for registered so that each module can use different image for login vs logout. Now I want to make the images respond as SCLogin modal popup
The topic has been locked.
Support Specialist
8 years 6 months ago #55114 by mel
The login button that is displayed is simply an anchor tag. You can 1) create a template override for the /modules/mod_sclogin/tmpl/login.php file to replace this anchor tag with whatever HTML you need to add the image or 2) you can create your own theme to add CSS for a background-image on that element.

If doing a template override, the line to update which shows the login button is the following around line 28.
echo '<div class="sourcecoast sclogin-modal-links sclogin"><a ' . $loginClass . ' href="#login-modal" role="button" data-toggle="' . $modalName . '">' . JText::_('MOD_SCLOGIN_LOGIN') . '</a>';

If you switch the 'Modal Style' option in SCLogin to text, I would think you can very easily put your own image inside that anchor replacing the text, such as the following untested code:
echo '<div class="sourcecoast sclogin-modal-links sclogin"><a ' . $loginClass . ' href="#login-modal" role="button" data-toggle="' . $modalName . '"><img src="blahblah" /></a>';

Likewise, you can override the logout.php file to alter the logout button (around line 40). Here's the existing code:
<input type="submit" name="Submit" class="<?php echo $logoutClass;?>" value="<?php echo JText::_('JLOGOUT');?>" />

If you can do this via just CSS styles, then I'd suggest creating your own theme so your changes don't get lost when upgrading.

This should help get you started, but let us know if you have any further questions.

-Melissa
The topic has been locked.