XF 1.x Template modification of message_user_info

abdfahim

Registered
I have made an addon in my localhost installation where I used template modification to replace the following in message_user_info template
Code:
<xen:if is="@messageShowCustomFields AND {$user.customFields}">
            <xen:hook name="message_user_info_custom_fields" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            
                <xen:foreach loop="$userFieldsInfo" key="$fieldId" value="$fieldInfo">
                    <xen:if is="{$fieldInfo.viewable_message} AND ({$fieldInfo.display_group} != 'contact' OR {$user.allow_view_identities} == 'everyone' OR ({$user.allow_view_identities} == 'members' AND {$visitor.user_id}))">
                        <xen:if hascontent="true">
                            <dl class="pairsJustified userField_{$fieldId}">
                                <dt>{xen:helper userFieldTitle, $fieldId}:</dt>
                                <dd><xen:contentcheck>{xen:helper userFieldValue, $fieldInfo, $user, {$user.customFields.{$fieldId}}}</xen:contentcheck></dd>
                            </dl>
                        </xen:if>
                    </xen:if>
                </xen:foreach>
                
            </xen:hook>
            </xen:if>

This works perfectly in my localhost where I use default style. However, it does not work in my website where I use EDGE because the above part is changed as
Code:
<xen:if is="@messageShowCustomFields AND {$user.customFields}">
            <xen:hook name="message_user_info_custom_fields" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            
                <xen:foreach loop="$userFieldsInfo" key="$fieldId" value="$fieldInfo">
                    <xen:if is="{$fieldInfo.viewable_message} AND ({$fieldInfo.display_group} != 'contact' OR {$user.allow_view_identities} == 'everyone' OR ({$user.allow_view_identities} == 'members' AND {$visitor.user_id}))">
                        <xen:if hascontent="true">
                            <dl class="pairsJustified userField_{$fieldId} xbCustomField">
                                <dt><xen:if is="@xb_fa_messageUserInfo"><i class="fa fa-cog fa-fw Tooltip" title="{xen:helper userFieldTitle, $fieldId}" data-offsetX="-6" data-offsetY="0"></i><xen:else />{xen:helper userFieldTitle, $fieldId}:</xen:if></dt>
                                <dd><xen:contentcheck>{xen:helper userFieldValue, $fieldInfo, $user, {$user.customFields.{$fieldId}}}</xen:contentcheck></dd>
                            </dl>
                        </xen:if>
                    </xen:if>
                </xen:foreach>
                
            </xen:hook>
            </xen:if>

So, obviously, my template modification does not find the part I am searching for.

What is the solution? Should I just create 2 template modifications - one for default style and one for EDGE? I never made an addon before, so I don't know how to handle such situation.
 

Russ

Pixel Exit Staff
Ya you can create two it won't do any harm. The XenBase specific one (edge) wouldn't apply to the default style as it wouldn't be able to find the provided code.
 

abdfahim

Registered
Thanks @Ross. When I did that, the modification was not applied to any style.Any idea why?

upload_2017-7-30_9-7-6.png


This is what I tried to find to replace

Code:
<xen:if is="@messageShowCustomFields AND {$user.customFields}">
            <xen:hook name="message_user_info_custom_fields" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            
                <xen:foreach loop="$userFieldsInfo" key="$fieldId" value="$fieldInfo">
                    <xen:if is="{$fieldInfo.viewable_message} AND ({$fieldInfo.display_group} != 'contact' OR {$user.allow_view_identities} == 'everyone' OR ({$user.allow_view_identities} == 'members' AND {$visitor.user_id}))">
                        <xen:if hascontent="true">
                            <dl class="pairsJustified userField_{$fieldId} xbCustomField">
                                <dt><xen:if is="@xb_fa_messageUserInfo"><i class="fa fa-cog fa-fw Tooltip" title="{xen:helper userFieldTitle, $fieldId}" data-offsetX="-6" data-offsetY="0"></i><xen:else />{xen:helper userFieldTitle, $fieldId}:</xen:if></dt>
                                <dd><xen:contentcheck>{xen:helper userFieldValue, $fieldInfo, $user, {$user.customFields.{$fieldId}}}</xen:contentcheck></dd>
                            </dl>
                        </xen:if>
                    </xen:if>
                </xen:foreach>
                
            </xen:hook>
            </xen:if>

upload_2017-7-30_9-10-29.png
 
Last edited:

Russ

Pixel Exit Staff
What's the code you're replacing it with? The full bit? can you screenshot that.
 

Pre-Sale Questions

If you have any questions or concerns you want to ask before you make a purchase don't hesitate to use one of our multiple support channels for your convenience.