Conditional Statements

Conditional Statements

I'm adding the following code for just guests and registered members
If the ads are going to show to guests and registered members, then you don't need to to use a conditional statement.

Any added content will show to both guests and registered members by default.
 
Will this one works on EXTRA.css?
Code:
<xen:if is="!{$visitor.user_id} AND {$contentTemplate} == 'forum_list'"> .PanelScroller {margin-bottom: -10px;} </xen:if>

I just apply it, but not working.
All I want is add -10px margin bottom for the Notices Block on forum_list only and for the guest view only.

Thanks!
 
This one still not working.
Code:
<xen:if is="!{$visitor.user_id} AND {$contentTemplate} == 'forum_list'"> 
.PanelScroller .scrollContainer { margin-bottom: 0 !important; } 
</xen:if>

Does the condition correct? and will still work on EXTRA.css ?
 
!{$visitor.user_id} can be used in CSS by checking class .LoggedOut in html element.
{$contentTemplate} == 'forum_list' can be used in CSS by checking #content.forum_list

Code:
.LoggedOut #content.forum_list .PanelScroller .scrollContainer { margin-bottom: 0 !important; }
 
Fixed :D
Thanks a lot!

But I changed it to apply both members and guest.
As members has the same issue also.

All I need is this base:
#content.forum_list
To target forum_list only.

Works like a charm ;)
 
Is it possible to add a "cookie" conditional?
Just would like to change the "Cookie law" notice from above and add it manually at the bottom.
Doing so, first visitors will see firstly the content and finally the notice.
 
Brogan updated Conditional Statements with a new update entry:

Manipulating HTML elements using CSS

Although it isn't possible to use conditional statements in EXTRA.css, it is possible to do something similar utilising CSS selectors.

In addition to the template name class (see point 3 of the FAQ for how to identify it), there are several other classes which can be used, such as:
  • LoggedIn
  • LoggedOut
  • Sidebar
  • NoSidebar
  • Responsive
  • NoResponsive

Using these classes,...

Read the rest of this update entry...
 
I am trying to put an ad after posts 1, 4, and 7 on every page, and show it only to guests.

Is the below code correct, and which template do I put in in?

Code:
<xen:if is="!{$visitor.user_id} and {$post.position} % {$xenOptions.messagesPerPage} == 1,4,7">

My adcode goes here

</xen:if>
 
Hi i want to use the following statement, which will filled from a textfield in the options.
Code:
<xen:if is="in_array({$forum.node_id}, array({$xenOptions.name_of_field}))">
This content will show in forums x, y, and z
</xen:if>

When i fill out the field with only one number it works. If i put more then one number, all comma seperated, in it will only show in the node with the first number.

Can someone tell me what's wrong ??
 
Top Bottom