1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Deactivate Sidebar Elements for not logged in Users

Discussion in 'XenForo Questions and Support' started by vFranky, Feb 27, 2016.

  1. vFranky

    vFranky Active Member


    I like to post some advertisment banners on the sidebar for not logged in users (guests). Is it possible to deactivate sidebar elements for certain usergroups? For example the display of recent posts etc? It would leave more free space for banners.

    Any idea? Thank you in advance!

    Kind regards,
  2. M@rc

    M@rc Well-Known Member

    You can use conditional statements in the template - https://xenforo.com/community/resources/conditional-statements.1604/

    2. How can I show content just to guests and hide it from logged in members?
    <xen:if is="!{$visitor.user_id}">
    This content will show to guests


    Or you can use the BD Widget Framework add-on, create the widget to place your ad and use the expression code from the description below the expression field from the widget you're creating to have it do it for you (it's basically the easiest way to display content to guests alone in the sidebar without messing with templates).
  3. vFranky

    vFranky Active Member

    Thank you. But where do I have to place your (red) code? Where can I find the sidebar code?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    vFranky likes this.
  5. AndyB

    AndyB Well-Known Member

    vFranky likes this.

Share This Page