-
AuthorPosts
-
February 6, 2013 at 9:24 pm #184747
For some reason I cant figure this out, maybe it’s because I’ve been staring at this for too long.
I wanted to edit JA Login to do two things.
1. Add a “My Profile” button next to the logout button, which takes them to a unique page and their met with a custom layout
2. Redirect after log-in to their custom page.I was wondering if anyone has any experience with this process. I’m trying to stay away from the obvious hidden menu item way of doing it. Help Needed ASAP!
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
February 6, 2013 at 9:42 pm #482743Adding a button to JA Login should be relatively simple. Simply edit the file mod_jalogintmpldefault.php and add your custom code in the area below. You will need to work out your code depending on exactly where you want to link to and how.
[PHP]<?php if ($params->get(‘greeting’)) : ?>
<div class=”login-greeting”>
<?php if($params->get(‘name’) == 0) :
echo JText::sprintf(‘HINAME’, $user->get(‘username’));
else :
echo JText::sprintf(‘HINAME’, $user->get(‘name’));
endif; ?>
</div>
<?php endif; ?>
<div class=”logout-button”>
<input type=”submit” name=”Submit” class=”button” value=”<?php echo JText::_(‘JLOGOUT’); ?>” />
</div>
<input type=”hidden” name=”option” value=”com_users” />
<input type=”hidden” name=”task” value=”user.logout” />
<input type=”hidden” name=”return” value=”<?php echo $return; ?>” />
<?php echo JHTML::_(‘form.token’);?>
</form>
</li>
<?php else : ?>
[/PHP]As for the redirect that will be simple if whatever component you are using for their custom page has a menu* item. For instance, if we create a menu item of the type “User Profile” then in the back end of the JA Login modules settings you can select it to go to this menu item on login. So from then on, if any user logs in they will then automatically go to their user profile. Yes, that is the obvious hidden menu method but as far as I can see it is the only sensible way of achieving what you want.
*I am sure you know this but I am detailing it for those that may not.
February 6, 2013 at 10:31 pm #482749Okay, I’ve got the log out and My profile button set up.
I was editing the right file. The main issue I had was I was editing inside modulesmod_jalogintmpl
And I needed to be in templatesMYTEMPLATEhtmlmod_jalogin so it wasn’t showing
I added the code under <input type=”submit” name=”Submit”…
How would I go about making the newly made My Profile button a link and not a logout button (which now it is) ?
i really need to get back into php lol.
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
February 6, 2013 at 10:36 pm #482750Ah, didn’t realise you we’re using a template with an override. What page exactly do you want the button to link to?
February 7, 2013 at 5:00 pm #482813I wanted to link it to a profile page for the user. I need to be able to edit it easily per user, so I’m debating on if I should use the default Joomla profile page or create my own. I’m thinking using the default Joomla page would be easier, So that’s what I need it to link to.
I have it inside the same div class to keep it looking the same.
February 11, 2013 at 6:37 pm #483093Does anyone know how I would go about linking the new “My Profile” button in JA_Login?
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
February 12, 2013 at 9:17 am #483171@asnmedia: You can try with my suggestion
1) Open templates/ja_mendozite/html/mod_jalogin/default.php file
from
<div class="logout-button">
<input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGOUT'); ?>" />
</div>change to
<div class="logout-button">
<a href="<?php echo JRoute::_('index.php?option=com_users&view=profile');?>">My Profile</a> <input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGOUT'); ?>" />
</div>
2) You can configure from back-end JA Login Module, see the screenshot
March 12, 2013 at 5:58 pm #486219I tried your suggestion, with one issue. It’s hard to explain so I’ll just attach a photo.
EDIT:
I fixed the button. I created a new div class. All I need is to send the button to profile page. it still acts like a log out button.
Could it be because of the top part <?php if($type == ‘logout’) : ?>
Heres what it looks like so far.
-
Ninja Lead Moderator
Ninja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
March 13, 2013 at 5:21 am #486282Please pm me with url, admin access and ftp account, i shall help you out.
-
AuthorPosts
Viewing 9 posts - 1 through 9 (of 9 total)This topic contains 9 replies, has 3 voices, and was last updated by Ninja Lead 11 years, 8 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum