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

XF 1.2 redirect to log-in page

Discussion in 'XenForo Questions and Support' started by Adam Howard, Jun 25, 2013.

  1. Adam Howard

    Adam Howard Well-Known Member

    Noticed a small change in 1.2

    Before if I added this to a select page

    PHP:
    <xen:if is="{$visitor.user_id}">
    PHP:
    </xen:if>
    The guest would be redirect to the log-in page or log-in overlay.

    This doesn't seem to be true in XenForo 1.2 .... Rather they're show this

    Capture.PNG

    ^ Which isn't exactly helpful.

    I know there is away to do it manually ....ie.. add the code to bring them to the log-on page, but I can't recall or seem to find it via search.
     
  2. Tracy Perry

    Tracy Perry Well-Known Member

    Are you adding that code to the notable members template? I think I remember reading that was what was used now instead of the old template name. I'm not running 1.2 (not even on my test bed yet since there are still several add-on's I use that are not compatible).
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Adding that xen:if won't automatically redirect guests.
    You still need the redirect code.

    Post exactly what you are entering and where.
     
    SneakyDave likes this.
  4. Adam Howard

    Adam Howard Well-Known Member

    Maybe it was an old add-on that made it happen.... But I'm trying through template modification

    Recent Activity = news_feed_page_global

    What's New? = find_new_threads

    To make it so only members can see the above pages.

    For now, I have it wrapped around with

    PHP:
    <xen:if is="{$visitor.user_id}">

    </
    xen:if>
     
  5. Adam Howard

    Adam Howard Well-Known Member

    SOLVED

    PHP:
    <xen:if is="{$visitor.user_id}">

    <
    xen:else />
    <
    xen:title>{xen:phrase log_in}</xen:title>

    <
    xen:include template="helper_login_form" />
    </
    xen:if>
    • Simple
    • Clean

    And it works good enough for me :)
     

Share This Page