Using .sm-user-loggedin
beardedgit
Registered Users Posts: 854 Major grins
I'm using the following code to make a couple of menu items show only when logged in:
Logged out:
Logged in:
I just want to be sure about what .sm-user-loggedin is doing - is it allowing only me to see the menu items when logged in, or is it allowing anyone logged in to see them?
.sm-page-widget-nav a[href$="/comments.mg?"], .sm-page-widget-nav a[href$="/stats/"], .sm-accordion-item.sm-nav-item-toplevel a[href$="/comments.mg?"], .sm-accordion-item.sm-nav-item-toplevel a[href$="/stats/"] { display:none } .sm-user-loggedin .sm-page-widget-nav a[href$="/comments.mg?"], .sm-user-loggedin .sm-page-widget-nav a[href$="/stats/"], .sm-user-loggedin .sm-accordion-item.sm-nav-item-toplevel a[href$="/comments.mg?"], .sm-user-loggedin .sm-accordion-item.sm-nav-item-toplevel a[href$="/stats/"] { display:inline }Site is http://beardedgit.smugmug.com/ (beware the animated .gifs!), here's what I see in the menu...
Logged out:
Logged in:
I just want to be sure about what .sm-user-loggedin is doing - is it allowing only me to see the menu items when logged in, or is it allowing anyone logged in to see them?
Yippee ki-yay, footer-muckers!
0
Comments
--- Denise
Musings & ramblings at https://denisegoldberg.blogspot.com
It's back to the drawing-board for me then - I was hoping that it would show the items only for me and only when I'm logged in, as I wanted to extend the idea to some future tinkerings that I'll want to keep out of the reach of others.
Any pointers to the right code would be much appreciated.
<body id="yui_3_8_0_1_1391621230553_2273" class="sm-user-pro sm-user-loggedin sm-user-owner
sm-page sm-page-node sm-page-node-3hGr6 sm-page-gallery sm-page-gallery-album" style="">
My Website index | My Blog
I just found this. Had to change from .sm-user-loggedin to .sm-user-owner
Using both hid the block to me logged in.
Not sure if it will work because I can't see logged out.
My Website index | My Blog
sm-user-owner is not there
<body id="yui_3_8_0_1_1391623009279_137" class="sm-user-pro sm-user-loggedin sm-page
sm-page-node sm-page-node-QQ7vv sm-page-home" style="">
So this class name can not be used to hide things from the public (other Smug uses that are logged in).
My Website index | My Blog
I have not unveiled so can't look not logged in.
My Website index | My Blog
OK, I've changed all of my instances of .sm-user-loggedin to .sm-user-owner and it looks OK to me.
If you could check it out from your end I'd be much obliged.
Sorry about the code-typo in my previous post :-(
If so you might have to use (long shot)
.sm-user-owner.sm-user-loggedin
with no space
adding space it doesn't work, tried it
BTW, I do not see the menu items
My Website index | My Blog
Thanks for the help, folks
My Website index | My Blog