XF 2.2 Hide 2 of 4 custom thread fields

PASS

Well-known member
I'm trying to hide 2 of 4 custom thread fields from showing in the post. I only want all 4 to show to the admin usergroup. I'm in the thread_view template but I'm not 100% on how to do it.

<xf:macro name="thread_custom_fields_status" arg-thread="!" arg-forum="!" arg-wrapperClass="">
<xf:if is="conditional here ????">
<div class="{$wrapperClass} js-threadStatusField"><xf:trim>
<xf:if contentcheck="true">
<div class="blockStatus blockStatus--info">ss
<xf:contentcheck>
<xf:macro template="custom_fields_macros" name="custom_fields_view"
arg-type="threads"
arg-group="thread_status"
arg-onlyInclude="{$forum.field_cache}"
arg-set="{$thread.custom_fields}"
arg-wrapperClass="blockStatus-message" />
</xf:contentcheck>
</div>
</xf:if>
</xf:trim></div></xf:if>
</xf:macro>
 
Last edited:
I am not getting what are you trying to do exactly.

You could wrap you conditional using something like this

HTML:
<xf:if is="$xf.visitor.is_admin">
   Your code
</xf:if>
 
I am not getting what are you trying to do exactly.
I have 4 custom thread fields showing in the post before the message. I would like only the admin to view all 4 and everyone else can see just the 2.

The field_ids are cv1, cv2, cv3, and cv4. Trying to hide cv3 and cv4 from everyone but the admins.
 
I can put the conditional in the custom thread field wrapper instead of the thread-view template.

2022-01-24_9-41-36.jpg

I also need the OP to be able to see the info they submitted. It is possible to only allow admins and the OP to see it in the post?
 
Any conditional I try in the wrapper html for the thread field doesn't work. I guess it has to be done in the thread_view template.

I need to target 2 field IDs and allow the OP and admins to view them in the post while hiding them from everyone else.

Anyone has any suggestions on how to accomplish that? Not even sure it it's possible.
 
Back
Top Bottom