Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 14, 20196 yr 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}}
March 14, 20196 yr Author Thank you, Opentype! 🙂 Very useful. I'm bookmarking it for future reference.
Archived
This topic is now archived and is closed to further replies.