2 questions re: navigation
Permalink 1 user found helpful
Hi,
1) When I enabled public profiles, the MEMBERS page showed up on my nav. I would like to add a page for "my profile" or something that jumps the user right to their personal page?
2) Is there a way to add, to the upper right, the standard section on member sites: username | log-out
Or some thing like that?
Any help appreciated, thank you!
Andrey
1) When I enabled public profiles, the MEMBERS page showed up on my nav. I would like to add a page for "my profile" or something that jumps the user right to their personal page?
2) Is there a way to add, to the upper right, the standard section on member sites: username | log-out
Or some thing like that?
Any help appreciated, thank you!
Andrey
I also would like to know how to do this, thanks
yeah. For the site profile, just add a link to /profile and then whichever user clicks on it they will be directed to their page. For the next one you'd have to use a bit of html and css. Youd want to create a new div area and position it correctly with html and css, and then in the div add <?php
$a = new Area('Login');
$a->display($c);
?>
and then add the content there, or just use this php code to signify the username and then a link to /login/logout for the sign out box.
$a = new Area('Login');
$a->display($c);
?>
and then add the content there, or just use this php code to signify the username
<?php $u = new User(); if ($u->isRegistered()) { ?> <?php if (Config::get("ENABLE_USER_PROFILES")) { $userName = '<a href="' . $this->url('/profile') . '">' . $u->getUserName() . '</a>'; } else { $userName = $u->getUserName(); } ?>
Hi,
When you say "For the site profile, just add a link to /profile" -- how can I do this in the navigation? I did not see an option in the auto-nav block to add something manually...
Thanks,
Andrey
When you say "For the site profile, just add a link to /profile" -- how can I do this in the navigation? I did not see an option in the auto-nav block to add something manually...
Thanks,
Andrey
no, if you want to include it in header nav what you need to do is go into dashboard, sitamp, click on home and click add an external link. then type inhttp://www.yoursite.com/profile... and then profile should show up in the header nav
Just blew my mind. Many thanks!
Andrey
Andrey
Weird but the php code for adding the username to my top nav sent my site blank, am not coder so have I forgotten to put something in? Thanks in advance
For the username, I just copied the code from the footer and put it into the header -- this worked for me, I did not try the above code. Maybe you could do the same.
Andrey
Andrey
yeah, I just copied the part relevant to the username, not the login, from the footer.
Ended up using the following code found on the forum by synlag. Seems to work ok and only shows the profile and logout when signed in.
<?php
$uinfo = new User();
if($uinfo->IsLoggedIn()){ ?>
<a href="<?php echo DIR_REL?>/index.php/login/-/logout">Logout</a> | <a href="<?php echo $this->url('/profile')?>">My Profile</a>
<?php
} else { ?>
<a href="<?php echo $this->url('/login')?>">Login</a> | <a href="<?php echo $this->url('/register')?>">Register</a>
<?php }?>
Thanks for suggestions! cheers
<?php
$uinfo = new User();
if($uinfo->IsLoggedIn()){ ?>
<a href="<?php echo DIR_REL?>/index.php/login/-/logout">Logout</a> | <a href="<?php echo $this->url('/profile')?>">My Profile</a>
<?php
} else { ?>
<a href="<?php echo $this->url('/login')?>">Login</a> | <a href="<?php echo $this->url('/register')?>">Register</a>
<?php }?>
Thanks for suggestions! cheers