Create conditional in template for specific userid

Tom McIntyre

Active member
I want to add a conditional to a template for userid = 1 (the owner of the site). But I cannot figure out how to do that.

Is the some way to specify a particular user in $xf.visitor... ? I am trying to show ad previews to only myself.
Code:
                <xf:if is="$xf.visitor.is_admin AND $xf.options.siropuAdsManagerPositionVisualization AND {$xf.samPositions.{$position}}">
                    <div class="samPositionPreview">{$xf.samPositions.{$position}|raw}</div>
                </xf:if>
 

TickTackk

Well-known member
Code:
                <xf:if is="($xf.visitor.user_id === <your user id goes here>) AND $xf.visitor.is_admin AND $xf.options.siropuAdsManagerPositionVisualization AND {$xf.samPositions.{$position}}">
                    <div class="samPositionPreview">{$xf.samPositions.{$position}|raw}</div>
                </xf:if>
 
Top