Fork me on GitHub

Show block to anonymouse users only?  Bottom

  • Hello,

    I have a situation, where i have to show a block to "Anonymouse" users only. When a user logs in the block should hide.

    How to do that?

    I am using PostNuke .75Gold with AutoTheme 1.7.

    Thanx in advance.
  • The easiest way is to add this to your theme.html template wherever the block should appear:

    Code

    <?php
        if (!pnUserLoggedIn())
            {
                ?>
                <!-- [BlockName-blocks] -->
                <?php
            }
    ?>


    John
  • Actually, the easiest way would be to use permissions. Tho with out knowing more details, it's hard to say what exactly to put there. What block is it?

    --
    Home Page | Find on Facebook | Follow on Twitter
  • mhalbrook

    Actually, the easiest way would be to use permissions.


    Using my brilliant super-powers of deduction (ie, noting that this was the poster's first post,) I assumed that the user does not yet have a handle on using permissions.

    For those of us who fully understand permissions, I agree that permissions are an easy way to achieve this. To newbies who need a "here and now" solution without having to learn something new first, I offer my method.

    The attempt was to offer a solution that would be viable even if there was no further input from the poster. Sometimes people never check back here for their answer...for whatever reason...and they don't realize that more info was needed to fix their issue, which creates a half-answered thread that is of no use to anyone in the future... To spend time on something that isn't going to benefit (many) someone(s) later on is a waste our valuable time. wink
  • I'd rather go with the "Right" way to do it. Using Permissions, it will stick regardless of theme change :)

    --
    Home Page | Find on Facebook | Follow on Twitter
  • I think both methods are right...

This list is based on users active over the last 60 minutes.