XF 1.5 Restrict Viewing of Homepage field to specific Usergroups

Alpha1

Well-known member
On Member Profile I want to restrict who can see the homepage field.

I tried a template modification but for some reason it fails:
Template: member_view

Find:
Code:
<xen:if is="{$user.homepage}">
    <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage, 'x'}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
</xen:if>
Replace:
<xen:if is="{$user.homepage} AND {xen:helper ismemberof, 4, 5, 29}"> <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage, 'x'}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl> </xen:if>

What am I doing wrong?
 
Rich (BB code):
<xen:if is="{$user.homepage} AND {xen:helper ismemberof, $visitor, 4, 5, 29}">
    <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage, 'x'}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
</xen:if>
 
I found the issue. Your code was correct, but it requires two template modifications. This one is also required on the same template:
Find:
Code:
<xen:if is="{$user.homepage}">
                                            <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage, 'x'}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
                                        </xen:if>
Replace;
Code:
<xen:if is="{$user.homepage} AND {xen:helper ismemberof, $visitor, 4, 5, 29}">
                                            <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage, 'x'}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
                                        </xen:if>
 
Back
Top Bottom