najaru Active member Oct 7, 2010 #1 Hi. If i want to insert a html code in template, and i want that this code is visible ONLY at 1 o 2 groups, what code i have to use? thanks
Hi. If i want to insert a html code in template, and i want that this code is visible ONLY at 1 o 2 groups, what code i have to use? thanks
L Lawrence Well-known member Oct 7, 2010 #2 <xen:if is="{$visitor.user_group_id} == '2'"> </xen:if> Upvote 0 Downvote
MentaL Well-known member Oct 7, 2010 #3 Awesome lawrence, would you happen to know how to set a condition for say if the post is number 1, that way we can use this code for guests and is post 1 thus being useful for an advertisement banner. Cheers. Upvote 0 Downvote
Awesome lawrence, would you happen to know how to set a condition for say if the post is number 1, that way we can use this code for guests and is post 1 thus being useful for an advertisement banner. Cheers.
L Lawrence Well-known member Oct 7, 2010 #4 It's $visitor.user_group_id The $user was for a foreach loop. For post number: <xen:if is="!{$post.position}"> </xen:if> The first post is position 0. If you would like to check for the 3rd post, try this: <xen:if is="{$post.position} == '2'"> </xen:if> Upvote 0 Downvote
It's $visitor.user_group_id The $user was for a foreach loop. For post number: <xen:if is="!{$post.position}"> </xen:if> The first post is position 0. If you would like to check for the 3rd post, try this: <xen:if is="{$post.position} == '2'"> </xen:if>
Michael Active member Oct 18, 2010 #6 Lawrence said: It's $visitor.user_group_id The $user was for a foreach loop. For post number: <xen:if is="!{$post.position}"> </xen:if> The first post is position 0. If you would like to check for the 3rd post, try this: <xen:if is="{$post.position} == '2'"> </xen:if> Click to expand... Sorry to bump this up but I cannot get your conditional to work in thread_view, should this one work in thread view? I am using it just after Code: <xen:edithint template="attached_files" /> </ol> Upvote 0 Downvote
Lawrence said: It's $visitor.user_group_id The $user was for a foreach loop. For post number: <xen:if is="!{$post.position}"> </xen:if> The first post is position 0. If you would like to check for the 3rd post, try this: <xen:if is="{$post.position} == '2'"> </xen:if> Click to expand... Sorry to bump this up but I cannot get your conditional to work in thread_view, should this one work in thread view? I am using it just after Code: <xen:edithint template="attached_files" /> </ol>
L Lawrence Well-known member Oct 19, 2010 #7 I tested it in thread_view, placed at the very bottom of the template just above these two closing tags: </xen:set> </xen:include> for example: Code: <xen:if is="!{$post.position}"> My advertisement code here that will display right after post #1 </xen:if> </xen:set> </xen:include> Upvote 0 Downvote
I tested it in thread_view, placed at the very bottom of the template just above these two closing tags: </xen:set> </xen:include> for example: Code: <xen:if is="!{$post.position}"> My advertisement code here that will display right after post #1 </xen:if> </xen:set> </xen:include>
Michael Active member Oct 19, 2010 #8 Im not seeing it in the source using this: Code: <xen:if is="{$visitor.is_admin}"> <xen:if is="!{$post.position}"> WOWOWOW </xen:if> </xen:if> and thats like so in the thread_view template: Code: <xen:include template="share_page"> <xen:set var="$url">{xen:link 'canonical:threads', $thread} <xen:if is="{$visitor.is_admin}"> <xen:if is="!{$post.position}"> WOWOWOW </xen:if> </xen:if> </xen:set> </xen:include> I also tried it after the last closing tags without it showing in the source. EDIT: All is well now, I needed to use it after the include post code for it to work as needed. Thank you Upvote 0 Downvote
Im not seeing it in the source using this: Code: <xen:if is="{$visitor.is_admin}"> <xen:if is="!{$post.position}"> WOWOWOW </xen:if> </xen:if> and thats like so in the thread_view template: Code: <xen:include template="share_page"> <xen:set var="$url">{xen:link 'canonical:threads', $thread} <xen:if is="{$visitor.is_admin}"> <xen:if is="!{$post.position}"> WOWOWOW </xen:if> </xen:if> </xen:set> </xen:include> I also tried it after the last closing tags without it showing in the source. EDIT: All is well now, I needed to use it after the include post code for it to work as needed. Thank you