Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
PrettyPixels Posted March 14, 2019 Posted March 14, 2019 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}}
PrettyPixels Posted March 14, 2019 Author Posted March 14, 2019 Thank you, Opentype! 🙂 Very useful. I'm bookmarking it for future reference.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.