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

XF 1.3 Conditional statement in "CSS" template.

Mian Shahid

Well-known member
#1
Hi, Can we use conditional statement in "CSS" templates? for example:

PHP:
<xen:if is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
<xen:else />
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
</xen:if>
If yes, kindly advise correct way to put these together.

Thank you in advance. :)
 

Milano

Well-known member
#3
CSS templates don't support conditional statements.
I don't think so.

Hi, Can we use conditional statement in "CSS" templates? for example:

PHP:
<xen:if is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
<xen:else />
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
</xen:if>
If yes, kindly advise correct way to put these together.

Thank you in advance. :)
I believe you can, why not try it yourself.