Jump to content


Photo
- - - - -

Dynamic Register/Login/Out link in Brandnav?


  • Please log in to reply
4 replies to this topic

#1 osgzach

osgzach

    Advanced Member

  • Members
  • 32 posts
  • LocationWI, USA
  • Framework Version:2.3.8
  • Country: Country Flag

Posted 04 January 2013 - 06:04 AM

Hi,

 

I am hoping this wouldn't be a complicated modification to do myself -  and possibly  in a way that I don't have to modify any main Pagelines templates themselves  (I am using the Customize Plugin)..   But I kind of have the feeling I may need to.. Then again I am asking here because I have no flipping clue :sword:

 

So

Please Login or Register to see this Hidden Content

is my site.  As you can see, I have a  "BrandNav" type setup (I believe),  a navigation menu right below my site logo,  serving as the main menu to link to other pages on the site.

 

You can also see my temporary solution where I just hardcoded a  "Register/Login"  link by adding a custom link to the  login.php  page,  and then applied some custom CSS to that menu item (didn't think it was gonna work, nice they are treated as individual units) to pad it all the way to the right margin of the menu.

 

 

But I would like a real dynamic text link to be there instead..   One that will change with the users status.   If they are not logged in, or register  it would say   "Register/Login",  but once they are logged in,  I want it to change to show  "Logout"  only.

 

It's very late (12am) here, but I did a little light reading,  and one page I found discussed how to add such a dynamic link to your site,  but was focused on doing a simple footer modification,  and what I assume was some custom PHP in  one or two files..

 

 

Unfortunately that doesn't really help me understand what I would need to modify in  Pagelines to get it to show up in the Menu there.    Can anyone possibly help me out,  and get me started ?



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 17945 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 04 January 2013 - 07:21 AM

Hi,

 

The simplest method would be to use CSS and the logged-in class, which is applied to the body when logged in. However, the best method would be to use a hook with the Wordpress conditional tags.

 

Please Login or Register to see this Hidden Content

 

Using the conditional tags would require knowledge of PHP, but the outcome will be better than using the CSS method and look more professional.



#3 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 04 January 2013 - 12:01 PM

Use a plugin ;)

Please Login or Register to see this Hidden Content



#4 osgzach

osgzach

    Advanced Member

  • Members
  • 32 posts
  • LocationWI, USA
  • Framework Version:2.3.8
  • Country: Country Flag

Posted 04 January 2013 - 10:45 PM

Thanks, I will research both of these options when I have the time this weekend :)



#5 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 05 January 2013 - 12:25 AM

Great.