Jump to content

Guest Conditional Help


PrettyPixels

Recommended Posts

I'm trying to write a conditional for displaying an IPS database field for logged in members, only. Guests should see an error message asking them to log in or register.

The code below is displaying the field to members only, but the error message doesn't display for guests. I can't figure out what I'm doing wrong. Can someone please take a look and point me in the right direction?

{{if !\IPS\Member::loggedIn()->member_id}}
  
<div class="error">This is only available to members. Please <a href="/login/">sign in</a> or <a href="/register/">join our community</a> to participate.</div>
  
{{else}}

  <div class="ipsType_richText ipsType_normal" style="padding: 0 20px;">
    {$formValue}
  </div>

{{endif}}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...