• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Conditionals in EXTRA.css

Ray

Active member
#1
I want to hide videos from some media sites in plain view using css, not sure if it's possible but here is what I did:
EXTRA.css
HTML:
<xen:if is="!{$visitor.user_id}">
DIV.hidevideo
{
display:none
}
</xen:if>
From BB Code Media Sites, I wrapped the embed code with:
HTML:
<DIV class="hidevideo"> embed html code </DIV>
The video should be hidden from guests and viewable by members. Currently, no one can view them.
Maybe xf conditionals cannot be used in EXTRA.css?
 

James

Well-known member
#3
I don't think you can use conditionals in any CSS files.

Do it the other way and apply the class of hidevideo to the template:
Code:
class="{xen:if '!{$visitor.user_id}', 'hidevideo'}"
 

James

Well-known member
#7
The template that applies the BBCode. If there's no template, just apply the CSS to the page container (or any of the head files) with a conditional. You can use conditionals in templates, so you could use your conditional as long as it's in a template.
Code:
<xen:if is="!{$visitor.user_id}">
<style>
//code
</style>
</xen:if>
 

Ray

Active member
#9
The template that applies the BBCode. If there's no template, just apply the CSS to the page container (or any of the head files) with a conditional. You can use conditionals in templates, so you could use your conditional as long as it's in a template.
Code:
<xen:if is="!{$visitor.user_id}">
<style>
//code
</style>
</xen:if>
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!!! Didn't think of that... Let me see if it works.