Hide widget with user.
-
Hi, somebody help me. I want to hide my widget with user (not anonymous). Please.
-
You want to hide a particular widget on a per user basis or are you talking about hiding the widget for users that are logged in and show it when you're not logged in. Correct?
-
@baris said:
Not sure if template conditionals work in widgets but you can try.
Create a html widget and put the following in it and see what happens.
<!-- IF !loggedIn --> <div> Widget for not logged in users </div> <!-- ENDIF !loggedIn -->
Yep they work in any template.
-
Sr, i checked some api, i see something wrong. when i show api i see loggedIn will equal true.
And my widget alway hide. -
@NgaNguyenDuy Put everything in the HTML portion of your widget, including the "container". Just replace {body} with what your widget will be.
-
@NgaNguyenDuy said:
Sr, i checked some api, i see something wrong. when i show api i see loggedIn will equal true.
And my widget alway hide.And don't forget about using
<!-- ELSE -->
. It also helps! -
Hmmmmm, there is an option already built in called "Hide from anonymous users?"
Why don't you use that instead, for your widget?
-
@NgaNguyenDuy said:
@trevor yes, i want to hide widget when user logged and show it when not logged.
@psychobunny he wants the reverse of what that button does?
-
@psychobunny I know, but i want to reverse what that button do.
-
Ran into this issue as well, used conditionals which Baris broke when everything switched over to loggedIn rather than isLoggedIn.
Ah well, it's nice having every conditional the same anyways!