Conditional Statements

Conditional Statements

Hello,

I want to show an ad in certain forums but not for a specific user group.
I can use this condtional:
Code:
<xen:if is="in_array({$forum.node_id}, array(17, 53, 38, 33, 28, 29, 1, 7, 10, 56, 58, 74, 13))">
This content will show in forums x, y, and z
</xen:if>

(Numbers are forum id's)
But what with the user group? How can i put this in plz?
 
Add an additional condition for the user group into the if statement, or, if it makes it easier, wrap the whole lot in a new conditional statement.
 
There are some conditional to hide / show some elements depends of the language selected?
I afraid it doesn't exist right? I really would like to have this conditional.
 
Last edited:
Something like this is possible?
--
<xen:if is="{$my_conditional_here}">
Show here a completely node*
</xen:if>
--
I'd like to show a completely node depending of my conditional. That's possible?
What I should put in
[Show here a completely node*]
Thanks!
 
Hello Brogan, Thanks $visitor.language_id is absolutely perfect (y)
I have no idea what you're trying to do.
I have 3 categories and each category contain a forum with a specific language.
using route filters, I have something like:
my.site/EN (English)
my.site/ES (Spanish)
my.site/FR (French)
I'm attempting to do something like this:
<xen:if is="{$visitor.language_id} == EN">
Show here my.site/EN (English)
</xen:if>
<xen:if is="{$visitor.language_id} == ES">

Show here my.site/ES (Spanish)
</xen:if>
<xen:if is="{$visitor.language_id} == FR">

Show here my.site/FR (French)
</xen:if>
I have an addon that auto-switch the language depends of the browser, so, each user will see information in their own language in forum_list depends of the language selected.
Has been possible until now show latest threads depending of the language, this is great. (y)
But I would like to show a completely forum in forum_list. possible?
Many thanks!
 
In the ad_below_top_breadcrumb template I want to display
Code:
<xen:hook name="dark_taigachat_full" params="{xen:array 'room=2'}" />
on page node 6 and
Code:
<xen:hook name="dark_taigachat_alt" />
on all other pages (including pages that aren't page nodes).

This is my code:
Code:
<xen:if is="{$contentTemplate} == '_page_node.6'">
<xen:hook name="dark_taigachat_full" params="{xen:array 'room=2'}" />
<xen:else/>
<xen:hook name="dark_taigachat_alt" />
</xen:if>
 
Hello!
I would like to use
HTML:
<xen:if is="{$visitor.language_id} == x">
</xen:if>
in the categories of resource_index so,
HTML:
<div class="resourceListSidebar">
    <div class="secondaryContent categoryList">
        <h3>{xen:phrase categories}</h3>
        <xen:if is="{$categories}">
            <ol>
            <xen:foreach loop="$categories" value="$_category">
                <li class="{xen:if '{$_category.resource_category_id} == {$selectedCategoryId}', selected}">
                    <a href="{xen:link resources/categories, $_category}" {xen:if $_category.category_description, 'title="{xen:helper striphtml, $_category.category_description}" class="Tooltip" data-tipclass="resourceCategoryTooltip"'}>{$_category.category_title}</a>
                    <span class="count">{xen:number $_category.resource_count}</span>
                </li>
            </xen:foreach>
            </ol>
        <xen:else />
            <div>{xen:phrase n_a}</div>
        </xen:if>
    </div>
</div>
Depending of the language selected it will show certain categories. I guess I have to change completely the codes in the template using the code of the inspector tool instead?

Appreciate some help on it.
 
Hello,

How can I have....

<xen:if is="1st CONDITION && 2nd CONDITION || 3rd CONDITION">

With the result either being...

1st condition + 2nd condition

...or...

1st condition + 3rd condition

The long version of what I am after would be...

<xen:if is="1st CONDITION && 2nd CONDITION || 1st CONDITION && 3rd CONDITION">

Is there a way to shorten it so that it's just 1st & "2nd || 3rd"?

Hope that makes sense

Thank you
 
Trying to add content using this in ad_message_body:

33. How can I show content in more than one post?
<xen:if is="in_array({$post.post_id}, array(x, y, z))">
This content will show in posts x, y, and z
</xen:if>


Or rather this:

<xen:if is="in_array({$post.post_id}, array(1, 5, 10))">
This content will show in posts x, y, and z
</xen:if>


But it doesn't appear to be showing.

If I use other conditionals it does work. So guests conditional or whatever.

What am I doing wrong?
 
Okay I've worked out that the post ID conditional also doesn't appear to be working for me.
So neither array of posts ID's, or an individual.

What could the reason be?
 
Hello,

give it also conditionals for the Xenforo Resource Manager? I search for a way to input code that only run in certain categories eg.

Can any body help?

Regards
 
Top Bottom