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

XF 1.3 Create a Notice with Criteria (Empty Custom field)

#1
Hey Guys!

I'm trying to setup a notice that is only visible to players who have one of their Custom Fields blank (empty).

Is there any way to set the criteria if a field is empty? I've only been able to make it show up for those who had an entry in the custom field but not those who's field was empty.

Thanks!
Clovis
 

Steve F

Well-known member
#2
You could just use some HTML/CSS to build a notice with a conditional to show to the right users.

I added the below to the ad_above_top_breadcrumb template.

You would want to replace the user field ID with your own (portion in red).

Code:
<xen:if is="!{$visitor.customFields.customField1}">
<div class="importantMessage">
<p>Hi, I'm a notice!</p>
</div>
</xen:if>
Results in:

upload_2016-2-21_15-50-58.png
 

adwade

Active member
#4
This worked great for me as well. I even included a LINK to the Personal Details page in our notice, to make it fast & easy. (y)
 

adwade

Active member
#5
You could just use some HTML/CSS to build a notice with a conditional to show to the right users...

Code:
<xen:if is="!{$visitor.customFields.customField1}">
<div class="importantMessage">
<p>Hi, I'm a notice!</p>
</div>
</xen:if>
Using '$visitor' causes the notice to show up for visitors.(i.e. anyone not logged in)

If I only want the notice displayed to members (who have a specific BLANK Custom User Field), once they are logged-in, what other variable could I use?

I tried using '$member' to no avail. :confused:
 
Last edited: